[PATCH] Fix NULL pointer access in getopt_internal()

Corinna Vinschen vinschen@redhat.com
Tue Nov 12 11:31:00 GMT 2013


On Nov 12 10:52, Sebastian Huber wrote:
> The getopt() family functions assume a NULL terminated argument vector
> (argv).  In case the ordering is PERMUTE, then the option processing
> stops if argv[data->optind] == NULL.  Do this also for the alternative
> orderings to avoid later NULL pointer read access.
> 
> newlib/ChangeLog
> 2013-11-12  Sebastian Huber  <sebastian.huber@embedded-brains.de>
> 
> 	* libc/libc/stdlib/getopt.c (getopt_internal): Fix NULL pointer
> 	access.

Thanks, I applied a simplified version which only tests once.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20131112/b9d036e5/attachment.sig>


More information about the Newlib mailing list