From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1771 invoked by alias); 18 Feb 2015 16:57:05 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 1761 invoked by uid 89); 18 Feb 2015 16:57:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: smtp.gentoo.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 18 Feb 2015 16:56:59 +0000 Received: from vapier (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with SMTP id 89701340728; Wed, 18 Feb 2015 16:56:56 +0000 (UTC) Date: Wed, 18 Feb 2015 16:57:00 -0000 From: Mike Frysinger To: Jiri Gaisler Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 09/23] sim/erc32: removed type mismatch compiler warnings Message-ID: <20150218165656.GV544@vapier> Mail-Followup-To: Jiri Gaisler , gdb-patches@sourceware.org References: <1424159099-5148-1-git-send-email-jiri@gaisler.se> <1424159099-5148-10-git-send-email-jiri@gaisler.se> <20150217091036.GM20008@vapier> <54E4A477.1010706@gaisler.se> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="e+JRL32uBeeWnrD4" Content-Disposition: inline In-Reply-To: <54E4A477.1010706@gaisler.se> X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00489.txt.bz2 --e+JRL32uBeeWnrD4 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 671 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 =3D fgets(lbuf, 1023, fp); > >=20 > > not a new issue, but fgets needs to die in a fire. getline is a trivia= l API and=20 > > does a lot of nice stuff for you :). >=20 > I thought fgets was secure, as it cannot write past the (statically) allo= cated 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 --e+JRL32uBeeWnrD4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJU5MRYAAoJEEFjO5/oN/WBsGwP+waKoIV6iB59kd5o+XIA7A+6 c1NBxPGZjVGOnMptGyALUc5EBavgzwRGXvFp1VpPP5CJbJmbr6wdLnocHpKadyWm DT44kLVKqLv272Bzmzf5GhhHN7M8iI5a1l1PSKHhN9kILnJtFGbAlaXKBfzz+Jyk yUCBshXBEhJQXtfDUgaKaQmQdGtZ4bwuGk6gK0AeASWf7faLVeMk3h7gJVsEFWM7 YDo5MCq6o/1wYcBRekUXraJOvpk5ymCGU76ni7PsJ3IXIBTBUBpdY+okJT647XF8 Oy4Bjh5Ub8wp/GcT9fHV79XX1ohHVoDnZewy9RcPTFWGzoNTDx8qGUdIfwYh98ja aCZTl4Dthvcn38L5l+BAkkcI6hZ40y7ky76q2XizusbsLsdkCRZ6uC/cAeGlWeb+ EH69X0VMrfHiB/br3igl0ueja6bly7Ofup+nF8isqGnzXg8N9fESz1l8u1W8rxt4 dBFBgBLFLiKE62vHc/I2zchNuuzXVuZ9VWydetiF4cpCwBQxSdw7dD2ETxLTSmiz OKRsiG8b9Bbs/ivSd+r+vXBX5+E1LhzXQSAiX3224EW/EOWYatcDBYmtc5DcF/dQ KuY6CAPSN5JdbB4HKXe7irgY/67KKgSVJ1apvDiA6gWiKfuiH9sHr76oNHSzP8DN GuaZZbBk7ruCGw5Ex+5z =Theh -----END PGP SIGNATURE----- --e+JRL32uBeeWnrD4--