Blob Blame History Raw
diff -up cups-1.2.12/cgi-bin/search.c.CVE-2008-0047 cups-1.2.12/cgi-bin/search.c
--- cups-1.2.12/cgi-bin/search.c.CVE-2008-0047	2006-09-17 20:01:47.000000000 +0100
+++ cups-1.2.12/cgi-bin/search.c	2008-04-01 16:55:01.000000000 +0100
@@ -171,7 +171,9 @@ cgiCompileSearch(const char *query)	/* I
       * string + RE overhead...
       */
 
-      wlen = (sptr - s) + 4 * wlen + 2 * strlen(prefix) + 4;
+      wlen = (sptr - s) + 2 * 4 * wlen + 2 * strlen(prefix) + 11;
+      if (lword)
+        wlen += strlen(lword);
 
       if (wlen > slen)
       {