Fix BZ #18757 (fmemopen doesn't fail with invalid modes)
Mike Frysinger
vapier@gentoo.org
Mon Aug 10 06:26:00 GMT 2015
On 09 Aug 2015 22:00, Paul Pluzhnikov wrote:
> - return _IO_fopencookie (c, mode, iof);
> + ret = _IO_fopencookie (c, mode, iof);
> +
> + if (__glibc_unlikely (ret == NULL))
> + {
> + /* BZ #18757 -- set EINVAL. */
> + __set_errno (EINVAL);
i'm not sure normalizing all errors into EINVAL is correct. you might get back
NULL if malloc failed in which case it'd be ENOMEM. i think we want to plumb
errno setting down further where the actual errors are flagged and leave this
func alone.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20150810/b37f5eb3/attachment.sig>
More information about the Libc-alpha
mailing list