]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Add nul checks to auth functions.
authorMichael R Sweet <msweet@msweet.org>
Tue, 28 Jul 2026 16:07:41 +0000 (12:07 -0400)
committerMichael R Sweet <msweet@msweet.org>
Tue, 28 Jul 2026 16:07:41 +0000 (12:07 -0400)
cups/auth.c

index b301b8278834cb92eeba547c889fdc841991fce5..27d4a71258806c339b9cf65f0af09df887911ccb 100644 (file)
@@ -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;
       }
     }