8011048: Possible reading from unmapped memory in UTF8::as_quoted_ascii()

Pass utf_length parameter to UTF8::as_quoted_ascii()

Reviewed-by: dcubed, minqi
This commit is contained in:
Ioi Lam 2013-04-01 14:05:41 -07:00
parent 388d803077
commit ba2c11a93a
3 changed files with 8 additions and 6 deletions

View file

@ -162,7 +162,7 @@ char* Symbol::as_quoted_ascii() const {
const char *ptr = (const char *)&_body[0];
int quoted_length = UTF8::quoted_ascii_length(ptr, utf8_length());
char* result = NEW_RESOURCE_ARRAY(char, quoted_length + 1);
UTF8::as_quoted_ascii(ptr, result, quoted_length + 1);
UTF8::as_quoted_ascii(ptr, utf8_length(), result, quoted_length + 1);
return result;
}