]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/http-support.c
Fix segfault in http_copy_decode() - wasn't checking for a NULL term
[thirdparty/cups.git] / cups / http-support.c
index 6855c2d1e1ea78da184781763eeaedcb42438ddb..83d6a91dda1e27a2399348eaf1f4851d6e912eb8 100644 (file)
@@ -1192,7 +1192,9 @@ http_copy_decode(char       *dst, /* O - Destination buffer */
   * or the end of the string.
   */
 
-  for (ptr = dst, end = dst + dstsize - 1; *src && !strchr(term, *src); src ++)
+  for (ptr = dst, end = dst + dstsize - 1;
+       *src && (!term || !strchr(term, *src));
+       src ++)
     if (ptr < end)
     {
       if (*src == '%' && decode)