From: Michael R Sweet Date: Tue, 28 Jul 2026 16:07:41 +0000 (-0400) Subject: Add nul checks to auth functions. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2a7ed9bcf5f2d9b72e8a5d1748cf1aef33cb0b66;p=thirdparty%2Fcups.git Add nul checks to auth functions. --- diff --git a/cups/auth.c b/cups/auth.c index b301b82788..27d4a71258 100644 --- a/cups/auth.c +++ b/cups/auth.c @@ -526,7 +526,8 @@ cups_auth_find(const char *www_authenticate, // I - Pointer into WWW-Authenticat DEBUG_printf("9cups_auth_find: After quoted: \"%s\"", www_authenticate); } - www_authenticate ++; + if (*www_authenticate) + www_authenticate ++; } DEBUG_printf("9cups_auth_find: After skip: \"%s\"", www_authenticate); @@ -616,7 +617,8 @@ cups_auth_param(const char *scheme, // I - Pointer to auth data scheme ++; } - scheme ++; + if (*scheme) + scheme ++; } // If this wasn't a parameter, we are at the end of this scheme's @@ -679,6 +681,9 @@ cups_auth_scheme(const char *www_authenticate, // I - Pointer into WWW-Authentic www_authenticate ++; } while (*www_authenticate && *www_authenticate != '\"'); + + if (!*www_authenticate) + break; } }