[PATCH 09/23] sim/erc32: removed type mismatch compiler warnings

Mike Frysinger vapier@gentoo.org
Wed Feb 18 16:57:00 GMT 2015


On 18 Feb 2015 15:40, Jiri Gaisler wrote:
> On 02/17/2015 10:10 AM, Mike Frysinger wrote:
> > On 17 Feb 2015 08:44, Jiri Gaisler wrote:
> >> --- a/sim/erc32/func.c
> >> +++ b/sim/erc32/func.c
> >>
> >> -	fgets(lbuf, 1023, fp);
> >> +	tmp = fgets(lbuf, 1023, fp);
> > 
> > not a new issue, but fgets needs to die in a fire.  getline is a trivial API and 
> > does a lot of nice stuff for you :).
> 
> I thought fgets was secure, as it cannot write past the (statically) allocated buffer.

it also mishandles lines longer than the arbitrarily picked length :)

i guess i should rephrase:
 - gets() must be nuked from orbit
 - fgets() should die in a fire
-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/gdb-patches/attachments/20150218/dc91809c/attachment.sig>


More information about the Gdb-patches mailing list