mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 03:34:29 +03:00
Fix invalid memory write on base64 forgiven decode
This commit is contained in:
@@ -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';
|
||||||
}
|
}
|
||||||
|
|
||||||
*aiming_size = j;
|
if (plain_text_size == 0) {
|
||||||
|
*aiming_size = k + 1;
|
||||||
|
} else {
|
||||||
|
*aiming_size = j;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user