Mercurial > hg > graal-compiler
comparison src/share/vm/oops/symbol.cpp @ 8851:8c03fc47511d
8011048: Possible reading from unmapped memory in UTF8::as_quoted_ascii()
Summary: Pass utf_length parameter to UTF8::as_quoted_ascii()
Reviewed-by: dcubed, minqi
author | iklam |
---|---|
date | Mon, 01 Apr 2013 14:05:41 -0700 |
parents | 63e54c37ac64 |
children | a1ebd310d5c1 |
comparison
equal
deleted
inserted
replaced
8849:e458120c6e1a | 8851:8c03fc47511d |
---|---|
160 | 160 |
161 char* Symbol::as_quoted_ascii() const { | 161 char* Symbol::as_quoted_ascii() const { |
162 const char *ptr = (const char *)&_body[0]; | 162 const char *ptr = (const char *)&_body[0]; |
163 int quoted_length = UTF8::quoted_ascii_length(ptr, utf8_length()); | 163 int quoted_length = UTF8::quoted_ascii_length(ptr, utf8_length()); |
164 char* result = NEW_RESOURCE_ARRAY(char, quoted_length + 1); | 164 char* result = NEW_RESOURCE_ARRAY(char, quoted_length + 1); |
165 UTF8::as_quoted_ascii(ptr, result, quoted_length + 1); | 165 UTF8::as_quoted_ascii(ptr, utf8_length(), result, quoted_length + 1); |
166 return result; | 166 return result; |
167 } | 167 } |
168 | 168 |
169 jchar* Symbol::as_unicode(int& length) const { | 169 jchar* Symbol::as_unicode(int& length) const { |
170 Symbol* this_ptr = (Symbol*)this; | 170 Symbol* this_ptr = (Symbol*)this; |