Patch for Review: JvGetStringUTFChars

Mohan Embar gnustuff@thisiscool.com
Wed Aug 13 11:18:00 GMT 2003


Hi Bryce,

>JvGetStringUTFRegion cannot be safely used without a corresponding call 
>to JvGetStringUTFLength. If its being used somewhere without one then 
>that is a serious bug.

>> - the _Jv_TempUTFString class and JV_TEMP_UTF_STRING macro
>>   (subsequent patch) will also shield us from this
>
>Seems like these are two solutions to the same problem. Why do we need 
>both?

You've argued me into a corner here. Would you be happy if I:

- rewrote the CNI function to do bounds checking, and
- rewrote _Jv_TempUTFString to use the old CNI functions
  to avoid the additional call to JvGetStringUTFLength?

That way the new CNI function would be available outside
of libjava and within libjava, people could use the new
class and the macro.

-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/






More information about the Java-patches mailing list