]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The web interface could hang on OpenBSD (STR #3176)
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 8 May 2009 04:53:19 +0000 (04:53 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 8 May 2009 04:53:19 +0000 (04:53 +0000)
Abort on early end-of-file.

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@8599 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES-1.3.txt
cgi-bin/var.c

index 540283d83afef0b8ea266274f4adfc1581281410..709f815dec429f580471f19af685ca2ae91cb644 100644 (file)
@@ -3,6 +3,7 @@ CHANGES-1.3.txt
 
 CHANGES IN CUPS V1.3.11
 
+       - The web interface could hang on OpenBSD (STR #3176)
        - The scheduler and cupsfilter utility did not handle rules starting
          with a negation operator properly (STR #3160)
        - The scheduler and cupsfilter utility would crash with certain MIME
index 85426dde39f57f908ace5dc17886005e1d173290..23fc1ae8b79fbb23ab56c7944bd7c069b646d702 100644 (file)
@@ -806,6 +806,18 @@ cgi_initialize_post(void)
       else
         nbytes = 0;
     }
+    else if (nbytes == 0)
+    {
+     /*
+      * CUPS STR #3176: OpenBSD: Early end-of-file on POST data causes 100% CPU
+      *
+      * This should never happen, but does on OpenBSD.  If we see early end-of-
+      * file, treat this as an error and process no data.
+      */
+
+      free(data);
+      return (0);
+    }
 
   data[length] = '\0';