Re: [PATCH] dns: remove redundant zero length namelen check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Miller <davem@xxxxxxxxxxxxx> wrote:

> > The zero namelen check is redundant as it has already been checked
> > for zero at the start of the function.  Remove the redundant check.
> > 
> > Addresses-Coverity: ("Logically Dead Code")
> > Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>
> 
> Applied to net-next.
> 
> However it does look like two sets of semantics were considered.
> In one case rejecting a zero namelen and in another having it
> mean whatever the strings length is modulo the max of 256.

It probably makes sense to merge the:

	if (namelen < 3 || namelen > 255)
		return -EINVAL;

check into the earlier:

	if (!name || namelen == 0)
		return -EINVAL;

check too.

David



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux