From matthias.andree@web.de  Wed Jul 11 02:49:22 2001
Return-Path: <matthias.andree@web.de>
Received: from krusty.e-technik.uni-dortmund.de (krusty.E-Technik.Uni-Dortmund.DE [129.217.163.1])
	by hub.freebsd.org (Postfix) with ESMTP id C28F837B405
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 11 Jul 2001 02:49:21 -0700 (PDT)
	(envelope-from matthias.andree@web.de)
Received: from emma1.emma.line.org (krusty.dt.e-technik.uni-dortmund.de [129.217.163.1])
	by krusty.e-technik.uni-dortmund.de (Postfix) with ESMTP id 5F139A3826
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 11 Jul 2001 11:49:20 +0200 (CEST)
Received: from freebsd.emma.line.org (freebsd.emma.line.org [192.168.0.4])
	by emma1.emma.line.org (Postfix) with ESMTP id 88736A2001
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 11 Jul 2001 11:49:19 +0200 (CEST)
Received: by freebsd.emma.line.org (Postfix, from userid 500)
	id B4B462D310; Wed, 11 Jul 2001 11:49:17 +0200 (CEST)
Message-Id: <20010711094917.B4B462D310@freebsd.emma.line.org>
Date: Wed, 11 Jul 2001 11:49:17 +0200 (CEST)
From: matthias.andree@web.de
Reply-To: matthias.andree@web.de
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: update to mergesort/merge.c: match i and size types.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         28890
>Category:       kern
>Synopsis:       [patch] merge.c compares int i against size_t size
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    brian
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 11 02:50:00 PDT 2001
>Closed-Date:    Mon Jan 24 13:58:50 GMT 2005
>Last-Modified:  Mon Jan 24 13:58:50 GMT 2005
>Originator:     Matthias Andree
>Release:        FreeBSD 4.3-RELEASE i386
>Organization:
>Environment:
System: FreeBSD freebsd.emma.line.org 4.3-RELEASE FreeBSD 4.3-RELEASE #5: Tue Jul 10 17:12:16 CEST 2001 root@freebsd.emma.line.org:/usr/src/sys/compile/M2A2 i386


	
>Description:
/usr/src/lib/libc/stdlib/merge.c compares i against size at lines 169
and 182.

i is of type int and size of type size_t, their signedness doesn't
match.
	
>How-To-Repeat:
run merge.c through gcc with -W -Wall
	
>Fix:
Apply this patch:

*** merge.c.old	Wed Jul 11 11:47:20 2001
--- merge.c	Wed Jul 11 11:47:43 2001
***************
*** 101,107 ****
  	register size_t size;
  	int (*cmp) __P((const void *, const void *));
  {
! 	register int i, sense;
  	int big, iflag;
  	register u_char *f1, *f2, *t, *b, *tp2, *q, *l1, *l2;
  	u_char *list2, *list1, *p2, *p, *last, **p1;
--- 101,108 ----
  	register size_t size;
  	int (*cmp) __P((const void *, const void *));
  {
! 	register size_t i;
! 	register int sense;
  	int big, iflag;
  	register u_char *f1, *f2, *t, *b, *tp2, *q, *l1, *l2;
  	u_char *list2, *list1, *p2, *p, *last, **p1;
	
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->brian 
Responsible-Changed-By: brian 
Responsible-Changed-When: Wed Jan 12 03:29:03 GMT 2005 
Responsible-Changed-Why:  
I'll commit this 

http://www.freebsd.org/cgi/query-pr.cgi?pr=28890 
State-Changed-From-To: open->patched 
State-Changed-By: brian 
State-Changed-When: Wed Jan 12 03:40:01 GMT 2005 
State-Changed-Why:  
Applied to -current.  I'll MFC in 7 days unless there are objections 

http://www.freebsd.org/cgi/query-pr.cgi?pr=28890 
State-Changed-From-To: patched->closed 
State-Changed-By: brian 
State-Changed-When: Mon Jan 24 13:58:29 GMT 2005 
State-Changed-Why:  
Committed to RELENG_5 

http://www.freebsd.org/cgi/query-pr.cgi?pr=28890 
>Unformatted:
