[PATCH] libnetworking/rtems_dhcp.c: Fix improper hostname handling in DHCP request

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Jan 4 12:21:59 UTC 2016



On 04/01/16 12:55, Daniel Gutson wrote:
>
> >
> >> +
> >> +      if ( (hostnamelen > 0) && (hostnamelen < 256) )
>
> Avoid magic numbers. Should this be MAXHOSTNAMELEN, and in any case ot 
> has been already limited before in the call to gethosname turning the 
> check unnecessary? (Don't believe me, please verify).
>

I think this should be UINT8_MAX, since it is later stored as an uint8_t.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list