On Fri, Feb 01, 2013 at 12:57:30AM -0500, Daniel Kahn Gillmor wrote:
> yeah, something like this looks about right;  but this still expects
> that the data passed to json_string() is all valid UTF-8 strings.  This
> should be true for PEM-encoded X.509 certificates (pkctype="x509pem"),
> but it's distinctly wrong for pkctype="x509der", which is capable of
> having embedded NULL bytes, etc.  So you'll still need to check the
> return values of json_string(), i think, and "return
> SOMETHING_HORRIBLE;" if it chokes.

That is a good idea, but it won't solve the UTF-8 problem, since
json_string() will happily accept invalid UTF-8.  This means
libmsv will need to either punt to the caller like jansson does,
or perform validation through iconv or something else.

> And of course, remember to deallocate the objects whatever objects were
> allocated once the HTTP POST has returned.  I confess i don't really
> grok libjansson's memory management model with all this "borrowed
> reference" stuff as well as i'd like, though.

Presumably judicious use of json_decref will make the garbage
collection work like magic.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to