mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-16 07:56:12 +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 */
|
/* single byte unicode (7 bit ASCII equivilent) has no validation */
|
||||||
count++;
|
count++;
|
||||||
if (count <= len) {
|
if (count <= len) {
|
||||||
if (c == 0)
|
if (c == 0 && input_len > i + 1) {
|
||||||
*data = utils::string::x2c(&c);
|
unsigned char z[2];
|
||||||
else
|
z[0] = *utf;
|
||||||
|
z[1] = *(utf + 1);
|
||||||
|
*data = utils::string::x2c((unsigned char*) &z);
|
||||||
|
} else
|
||||||
*data++ = c;
|
*data++ = c;
|
||||||
}
|
}
|
||||||
} else if ((c & 0xE0) == 0xC0) {
|
} else if ((c & 0xE0) == 0xC0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user