Subject: kern/7163: -current kernel build failed in net/slcompress.c + FIX
To: None <gnats-bugs@gnats.netbsd.org>
From: David Forbes <david@flossy.u-net.com>
List: netbsd-bugs
Date: 03/15/1999 22:09:46
>Number:         7163
>Category:       kern
>Synopsis:       -current kernel build failed in net/slcompress.c + FIX
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 15 14:20:00 1999
>Last-Modified:
>Originator:     David Forbes
>Organization:
	
>Release:        13th March tarballs
>Environment:
	
System: NetBSD crowley.our-flat.net 1.3K NetBSD 1.3K (CROWLEY) #0: Tue Mar 9 07:01:33 GMT 1999 david@crowley.our-flat.net:/usr/home/david/netbsd-current/src/sys/arch/arm32/compile/CROWLEY arm32


>Description:

Kernel build from source tar balls (13th March) fails, complaining that
passing arg 1 to memmove() in net/slcompress.c (line 465) makes a pointer from
an integer without a cast. 


>How-To-Repeat:
	
>Fix:

Judging by the code, it's just missing a (u_char *) cast, so here's a patch:
(I'm not an expert in this area, but it seems fairly obvious in the context
- I'm testing a kernel built with this now and it seems okay.)

*** slcompress.c	Mon Mar 15 21:54:27 1999
--- slcompress.c~	Sat Mar 13 12:14:53 1999
***************
*** 462,468 ****
  	 */
  	if ((long)cp & 3) {
  		if (len > 0)
! 			memmove((u_char *)((long)cp &~ 3), cp, len);
  		cp = (u_char *)((long)cp &~ 3);
  	}
  	cp -= hlen;
--- 462,468 ----
  	 */
  	if ((long)cp & 3) {
  		if (len > 0)
! 			memmove(((long)cp &~ 3), cp, len);
  		cp = (u_char *)((long)cp &~ 3);
  	}
  	cp -= hlen;


>Audit-Trail:
>Unformatted: