Fix null byte convertion into utf8toUnicode

This commit is contained in:
Breno Silva 2013-07-04 03:34:10 -07:00
parent 229d4e4fe2
commit a6fd09b691

View File

@ -120,8 +120,13 @@ char *utf8_unicode_inplace_ex(apr_pool_t *mp, unsigned char *input, long int inp
if ((c & 0x80) == 0) {
/* single byte unicode (7 bit ASCII equivilent) has no validation */
count++;
if(count <= len)
*data++ = c;
if(count <= len) {
if(c == 0)
*data = x2c(&c);
else
*data++ = c;
}
}
/* If first byte begins with binary 110 it is two byte encoding*/
else if ((c & 0xE0) == 0xC0) {