mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Fixed bad memory access in utf8ToUnicode class
This commit is contained in:
parent
fd341145d5
commit
068a3eb517
@ -92,9 +92,12 @@ char *Utf8ToUnicode::inplace(unsigned char *input,
|
||||
/* single byte unicode (7 bit ASCII equivilent) has no validation */
|
||||
count++;
|
||||
if (count <= len) {
|
||||
if (c == 0)
|
||||
*data = utils::string::x2c(&c);
|
||||
else
|
||||
if (c == 0 && input_len > i + 1) {
|
||||
unsigned char z[2];
|
||||
z[0] = *utf;
|
||||
z[1] = *(utf + 1);
|
||||
*data = utils::string::x2c((unsigned char*) &z);
|
||||
} else
|
||||
*data++ = c;
|
||||
}
|
||||
} else if ((c & 0xE0) == 0xC0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user