[rfc][icedtea-web] Fix for PR518, NPString.utf8characters not guaranteed to be null-terminated

Adam Domurad adomurad at redhat.com
Fri Jun 8 09:02:39 PDT 2012


OK, attached.

On Fri, 2012-06-08 at 11:32 -0400, Danesh Dadachanji wrote:
> On 07/06/12 04:43 PM, Adam Domurad wrote:
> > Here is a patch for consideration for backporting that is suitable for
> > 1.2&  1.1.
> >
> 
> Looks good to me for backport. One thing that slipped through the review in the original commit is adding a NEWS entry. Could you do so 
> for all 3 branches and post a patch back here? You will have to update the ChangeLog for 1.2 and 1.1 mentioning this too.
> 
> Thanks for the backports!
> 
> Cheers,
> Danesh
> 
> > On Mon, 2012-06-04 at 11:53 -0400, Deepak Bhole wrote:
> >> * Adam Domurad<adomurad at redhat.com>  [2012-06-04 11:42]:
> >>> Hey all. This is a fix for PR518 that adds a utility function for
> >>> wrapping NPString's in a null terminated std::string. It is used
> >>> wherever utf8characters was accessed previously. This also has the
> >>> benefit of consolidating some #ifdef blocks to one location.
> >>>
> >>> I took the route of using std::string over gchar* as suggested in the
> >>> bug report to be conveniently sure memory is freed.
> >>>
> >>> (Note, passing along std::string's by value is quite efficient because
> >>> GCC uses reference counting techniques for sharing of character arrays
> >>> used in std::string)
> >>>
> >>
> >> Looks fine to me. OK for HEAD.
> >>
> >> Cheers,
> >> Deepak
> >>
> >>> ChangeLog:
> >>> 2012-06-04  Adam Domurad<adomurad at redhat.com>
> >>>
> >>> 	This patch fixes PR518, ensures null termination of strings based off
> >>> 	of NPVariant results.	
> >>> 	* plugin/icedteanp/IcedTeaPluginUtils.h: Added declaration of
> >>> 	NPVariantAsString
> >>> 	* plugin/icedteanp/IcedTeaPluginUtils.cc
> >>> 	(NPVariantAsString): New. Converts an NPVariant to a
> >>> 	std::string, assumes it is a string.
> >>> 	(isObjectJSArray): Now uses NPVariantAsString, minor cleanup.
> >>> 	* plugin/icedteanp/IcedTeaJavaRequestProcessor.cc
> >>> 	(plugin_get_documentbase): Now uses NPVariantAsString.
> >>> 	* plugin/icedteanp/IcedTeaNPPlugin.cc
> >>> 	(NPVariantToString): Now uses NPVariantAsString, minor cleanup.
> >>>
> >>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: NEWS-HEAD.patch
Type: text/x-patch
Size: 492 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120608/8a046e73/NEWS-HEAD.patch 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: updatedfixpr518-1.1.patch
Type: text/x-patch
Size: 6634 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120608/8a046e73/updatedfixpr518-1.1.patch 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: updatedfixpr518-1.2.patch
Type: text/x-patch
Size: 6684 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120608/8a046e73/updatedfixpr518-1.2.patch 


More information about the distro-pkg-dev mailing list