Index: cups-1.2.12/cgi-bin/search.c =================================================================== --- cups-1.2.12.orig/cgi-bin/search.c +++ cups-1.2.12/cgi-bin/search.c @@ -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) {