]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/HttpHeader.cc
Cleanup: base64 coder de-duplication and upgrade
[thirdparty/squid.git] / src / HttpHeader.cc
index b4488024c33c416fe1c4f69e7a7677a8b04f98be..30ef2389584a1acf172c4e99117b5c0007a78348 100644 (file)
@@ -1414,7 +1414,10 @@ HttpHeader::getAuth(http_hdr_type id, const char *auth_scheme) const
     if (!*field)               /* no authorization cookie */
         return NULL;
 
-    return base64_decode(field);
+    static char decodedAuthToken[8192];
+    const int decodedLen = base64_decode(decodedAuthToken, sizeof(decodedAuthToken)-1, field);
+    decodedAuthToken[decodedLen] = '\0';
+    return decodedAuthToken;
 }
 
 ETag