]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http: fix the auth check
authorDaniel Stenberg <daniel@haxx.se>
Fri, 21 Feb 2025 11:28:19 +0000 (12:28 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 21 Feb 2025 12:53:14 +0000 (13:53 +0100)
It used the wrong variable.

Follow-up to d1fc1c4a854d5cc809cc4ae59a9511900228023a
Pointed-out-by: qhill on github
Ref: https://github.com/curl/curl/pull/16406#pullrequestreview-2632734134
Closes #16419

lib/http.c

index 4bbe827a1d9132863c7eaaa389b53671d326d271..86e252118438e9d56db03a65cfc27e2dc9c61bbc 100644 (file)
@@ -880,7 +880,7 @@ static bool authcmp(const char *auth, const char *line)
 {
   /* the auth string must not have an alnum following */
   size_t n = strlen(auth);
-  return strncasecompare(auth, line, n) && !ISALNUM(auth[n]);
+  return strncasecompare(auth, line, n) && !ISALNUM(line[n]);
 }
 #endif