[PATCH, jit]: Robustify vasprintf error checks

Uros Bizjak ubizjak@gmail.com
Thu Jan 1 00:00:00 GMT 2015


On Fri, Mar 13, 2015 at 6:55 PM, David Malcolm <dmalcolm@redhat.com> wrote:

>> As documented in [1] asprintf and vasprintf return:

> I assume that we can rely that any vasprintf implementation manages on
> failure to at least either write NULL to *ret or to return -1, even if
> some of them fail to do both?

Yes, this is correct. The patch checks both ways. Please also note
that linux manpages claim that in case of error, *ret will be
undefined, while FreeBSD implementation will set *ret to NULL on
error.

> OK for trunk.

Thanks, commited.

Uros.



More information about the Jit mailing list