mirror of
https://github.com/samba-team/samba.git
synced 2025-08-02 00:22:11 +03:00
util/rfc1738_unescape(): return end pointer or NULL on error
At present we don't detect errors, but when we do we'll return NULL. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
committed by
Douglas Bagnall
parent
6ef6ddce5a
commit
a4c853a7de
@ -1260,7 +1260,7 @@ static void manage_squid_basic_request(enum stdio_helper_mode stdio_helper_mode,
|
||||
struct ntlm_auth_state *state,
|
||||
char *buf, int length, void **private2)
|
||||
{
|
||||
char *user, *pass;
|
||||
char *user, *pass;
|
||||
user=buf;
|
||||
|
||||
pass=(char *)memchr(buf,' ',length);
|
||||
@ -1273,8 +1273,20 @@ static void manage_squid_basic_request(enum stdio_helper_mode stdio_helper_mode,
|
||||
pass++;
|
||||
|
||||
if (state->helper_mode == SQUID_2_5_BASIC) {
|
||||
rfc1738_unescape(user);
|
||||
rfc1738_unescape(pass);
|
||||
char *end = rfc1738_unescape(user);
|
||||
if (end == NULL || (end - user) != strlen(user)) {
|
||||
DEBUG(2, ("Badly rfc1738 encoded username: %s; "
|
||||
"denying access\n", user));
|
||||
printf("ERR\n");
|
||||
return;
|
||||
}
|
||||
end = rfc1738_unescape(pass);
|
||||
if (end == NULL || (end - pass) != strlen(pass)) {
|
||||
DEBUG(2, ("Badly encoded password for %s; "
|
||||
"denying access\n", user));
|
||||
printf("ERR\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (check_plaintext_auth(user, pass, False)) {
|
||||
|
Reference in New Issue
Block a user