RE: svn commit: r1811786 - /subversion/trunk/subversion/bindings/swig/include/svn_types.swg

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

RE: svn commit: r1811786 - /subversion/trunk/subversion/bindings/swig/include/svn_types.swg

Bert Huijben-5


> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]
> Sent: woensdag 11 oktober 2017 05:08
> To: [hidden email]
> Subject: svn commit: r1811786 -
> /subversion/trunk/subversion/bindings/swig/include/svn_types.swg
>
> Author: jamessan
> Date: Wed Oct 11 03:08:19 2017
> New Revision: 1811786
>
> URL: http://svn.apache.org/viewvc?rev=1811786&view=rev
> Log:
> * subversion/bindings/swig/include/svn_types.swg:
>   (unsigned char digest typemap): When svn_md5_digest_to_cstring()
> returns NULL,
>     pass an empty string to rb_str_new2().

This problem is so common we even have a special svn_md5_digest_to_cstring_display() function for this case that explicitly avoids returning NULL. You might want to switch to that version to document the requested behavior.

(Found via the branch update from brane)

        Bert


Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1811786 - /subversion/trunk/subversion/bindings/swig/include/svn_types.swg

James McCoy-2
On Mon, Oct 23, 2017 at 12:28:01PM +0200, Bert Huijben wrote:

> > -----Original Message-----
> > From: [hidden email] [mailto:[hidden email]]
> > Sent: woensdag 11 oktober 2017 05:08
> > To: [hidden email]
> > Subject: svn commit: r1811786 -
> > /subversion/trunk/subversion/bindings/swig/include/svn_types.swg
> >
> > Author: jamessan
> > Date: Wed Oct 11 03:08:19 2017
> > New Revision: 1811786
> >
> > URL: http://svn.apache.org/viewvc?rev=1811786&view=rev
> > Log:
> > * subversion/bindings/swig/include/svn_types.swg:
> >   (unsigned char digest typemap): When svn_md5_digest_to_cstring()
> > returns NULL,
> >     pass an empty string to rb_str_new2().
>
> This problem is so common we even have a special
> svn_md5_digest_to_cstring_display() function for this case that
> explicitly avoids returning NULL. You might want to switch to that
> version to document the requested behavior.

That would be inconsistent with the way the other swig bindings handle
this typemap.  Maybe all of them should be changed to use the _display()
variant, but I'm not sure of where these are used or how the consumers
would handle that.  Instead I took the conservative approach of fixing
the obvious crash.

Cheers,
--
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7  2D23 DFE6 91AE 331B A3DB