Subject: bin/32628: Missing cast in sbin/ifconfig/ifconfig.c
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <yves-emmanuel.jutard@fr.thalesgroup.com>
List: netbsd-bugs
Date: 01/25/2006 16:00:01
>Number:         32628
>Category:       bin
>Synopsis:       Missing cast in sbin/ifconfig/ifconfig.c
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 25 16:00:01 +0000 2006
>Originator:     Yves-Emmanuel JUTARD
>Release:        3.0.0
>Organization:
THALES Communication
>Environment:
custom environment : recompiled from /src, only some parts of NetBSD are used (TCP/IP stack and some parts of the kernel)
>Description:
in sbin/ifconfig/ifconfig.c,v 1.152 l. 1596,
function 'strncasecmp' is called with its second arg being of type 'u_int8_t' (equivalent to unsigned char) instead of 'const char *'. Metrowerks compiler refuse to compile it.
>How-To-Repeat:
Compile this file with some type checking activated.
>Fix:
A cast should be added on the second arg, maybe like that :
strncasecmp("persist", (char *)nwkey.i_key[0].i_keydat, 7)