[PATCH] Fix some warnings from Coverity
uri at samba.org
Thu Dec 1 20:21:21 UTC 2016
On 12/01/2016 09:54 PM, Volker Lendecke wrote:
> On Thu, Dec 01, 2016 at 08:50:46PM +0100, Volker Lendecke wrote:
>> On Thu, Dec 01, 2016 at 11:44:11AM -0800, Jeremy Allison wrote:
>>> On Thu, Dec 01, 2016 at 08:34:37PM +0100, Andreas Schneider wrote:
>>>> some minor things, they will make Coverity happy.
>>>> Review and push appreciated.
>>> [PATCH 2/2] libsocket: Make sure ifr.ifr_name is null-terminated
>> Does that have to be null-terminated for the ioctl at all?
> Some cross-ref suggests not:
> has a call to
> if (!strncmp(dev->name, name, IFNAMSIZ))
> which says it doesn't have to be null-terminated. No clue if that is
> the right reference though.
> If we null-terminate, we might miss weird long interface names.
> Any insights someone?
We've been here before:
The conclusion then was that the ethtool utility expects it to be
null-terminated and fit inside IFNAMSIZ with the zero termination, so we
can do it too.
More information about the samba-technical