mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-16 07:56:12 +03:00
Fix invalid memory write on base64 forgiven decode
This commit is contained in:
parent
7be5fde62a
commit
a4c7d534f2
@ -186,8 +186,8 @@ void Base64::decode_forgiven_engine(unsigned char *plain_text,
|
|||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
k = j;
|
k = j;
|
||||||
|
|
||||||
if (ch == b64_pad) {
|
if (ch == b64_pad) {
|
||||||
switch(i % 4) {
|
switch(i % 4) {
|
||||||
case 1:
|
case 1:
|
||||||
@ -206,7 +206,11 @@ void Base64::decode_forgiven_engine(unsigned char *plain_text,
|
|||||||
plain_text[j] = '\0';
|
plain_text[j] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (plain_text_size == 0) {
|
||||||
|
*aiming_size = k + 1;
|
||||||
|
} else {
|
||||||
*aiming_size = j;
|
*aiming_size = j;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user