Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Oct 2017 14:15:32 +0100
From:      David Chisnall <theraven@FreeBSD.org>
To:        Cy Schubert <Cy.Schubert@komquats.com>
Cc:        Alexey Dokuchaev <danfe@FreeBSD.org>, Cy Schubert <cy@FreeBSD.org>, ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   Re: svn commit: r451623 - in head/net/tcpview: . files
Message-ID:  <FF103639-6483-416C-8936-304F727BCB3F@FreeBSD.org>
In-Reply-To: <201710101305.v9AD5k9x056952@slippy.cwsent.com>
References:  <201710101305.v9AD5k9x056952@slippy.cwsent.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 10 Oct 2017, at 14:05, Cy Schubert <Cy.Schubert@komquats.com> wrote:
>=20
>>>> gets(3) called only once in this port; why not simply patch that
>>>> single call properly instead of bringing in a "poor man's" macro?
>>>=20
>>> As an example. To open discussion of possibilities.
>>=20
>> I don't think that having this (even in some extra-guarded form) is
>> good *general* solution.  Macros are fragile and things can go south
>> when the argument is more just a simple pointer.
>=20
> Which is the limitation of this. As I said, it was not perfict.

This version, with no guards, looks quite dangerous.  It=E2=80=99s =
difficult to see from the context, but if str is a char*, then this will =
always simply set the first byte to null, without reading anything.  The =
compilation will succeed, yet the code will behave in an unexpected way. =
=20

David




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FF103639-6483-416C-8936-304F727BCB3F>