Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Sep 2001 03:06:26 +0200 (CEST)
From:      Dan Lukes <dan@obluda.cz>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/30864: bootpd/tools/bootptest/print-bootp.c - incorrect printf format
Message-ID:  <200109270106.f8R16Qa42940@xkulesh.vol.cz>

next in thread | raw e-mail | index | archive | help

>Number:         30864
>Category:       bin
>Synopsis:       bootpd/tools/bootptest/print-bootp.c - incorrect printf format
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 27 01:00:02 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Dan Lukes
>Release:        FreeBSD 4.4-STABLE i386
>Organization:
Obludarium
>Environment:
System: FreeBSD 4.4-STABLE #31: Thu Sep 20 23:06:53 CEST 2001 i386


>Description:
	incorrect printf format cause incorrect print of information (and
may cause abend)

	the format for printing of ntohl(..) should be "%ld" not "%d"
>How-To-Repeat:
>Fix:

--- libexec/bootpd/tools/bootptest/print-bootp.c.orig	Sat Aug 28 02:09:25 1999
+++ libexec/bootpd/tools/bootptest/print-bootp.c	Thu Sep 27 03:00:31 2001
@@ -120,7 +120,7 @@
 		printf(" hops:%d", bp->bp_hops);
 
 	if (bp->bp_xid)
-		printf(" xid:%d", ntohl(bp->bp_xid));
+		printf(" xid:%ld", ntohl(bp->bp_xid));
 
 	if (bp->bp_secs)
 		printf(" secs:%d", ntohs(bp->bp_secs));
@@ -336,7 +336,7 @@
 		case 'l':				/* Long words */
 			while (len >= 4) {
 				bcopy((char *) bp, (char *) &ul, 4);
-				printf("%d", ntohl(ul));
+				printf("%ld", ntohl(ul));
 				bp += 4;
 				len -= 4;
 				if (len) printf(",");
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200109270106.f8R16Qa42940>