From owner-freebsd-bugs Thu Sep 27 1: 0:15 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 8731B37B431 for ; Thu, 27 Sep 2001 01:00:02 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f8R802C48047; Thu, 27 Sep 2001 01:00:02 -0700 (PDT) (envelope-from gnats) Received: from xkulesh.vol.cz (xkulesh.vol.cz [195.250.154.106]) by hub.freebsd.org (Postfix) with ESMTP id C75C637B406 for ; Thu, 27 Sep 2001 00:51:27 -0700 (PDT) Received: (from root@localhost) by xkulesh.vol.cz (8.11.4/8.11.4) id f8R16Qa42940; Thu, 27 Sep 2001 03:06:26 +0200 (CEST) (envelope-from dan) Message-Id: <200109270106.f8R16Qa42940@xkulesh.vol.cz> Date: Thu, 27 Sep 2001 03:06:26 +0200 (CEST) From: Dan Lukes Reply-To: Dan Lukes To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: bin/30864: bootpd/tools/bootptest/print-bootp.c - incorrect printf format Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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