]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cgi-bin/var.c
Merge changes from CUPS 1.4svn-r8606.
[thirdparty/cups.git] / cgi-bin / var.c
index 6470fcbfd351c757acd28f741d86a4a32fac3b8d..628ce8add577b80f624384b14ebfe4e74ad366df 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';