From owner-freebsd-bugs@FreeBSD.ORG Sat Dec 22 12:40:01 2012 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3FB7C931 for ; Sat, 22 Dec 2012 12:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id ECE218FC17 for ; Sat, 22 Dec 2012 12:40:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id qBMCe0KS022731 for ; Sat, 22 Dec 2012 12:40:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id qBMCe01q022727; Sat, 22 Dec 2012 12:40:00 GMT (envelope-from gnats) Resent-Date: Sat, 22 Dec 2012 12:40:00 GMT Resent-Message-Id: <201212221240.qBMCe01q022727@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Henning Petersen Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7FDA8914 for ; Sat, 22 Dec 2012 12:37:10 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 64EE78FC0A for ; Sat, 22 Dec 2012 12:37:10 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id qBMCb98h011780 for ; Sat, 22 Dec 2012 12:37:09 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id qBMCb9Ux011779; Sat, 22 Dec 2012 12:37:09 GMT (envelope-from nobody) Message-Id: <201212221237.qBMCb9Ux011779@red.freebsd.org> Date: Sat, 22 Dec 2012 12:37:09 GMT From: Henning Petersen To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: bin/174631: Sizeof ebuf is wrong in tftp-io.c . X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Dec 2012 12:40:01 -0000 >Number: 174631 >Category: bin >Synopsis: Sizeof ebuf is wrong in tftp-io.c . >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Dec 22 12:40:00 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Henning Petersen >Release: Freebsd-current >Organization: >Environment: >Description: Sieof ebuf is wrong, sizeof buf is used. >How-To-Repeat: >Fix: diff -u -p -r1.8 tftp-io.c --- libexec/tftpd/tftp-io.c 17 Nov 2012 01:50:12 -0000 1.8 +++ libexec/tftpd/tftp-io.c 22 Dec 2012 11:17:19 -0000 @@ -87,14 +87,13 @@ errtomsg(int error) { static char ebuf[40]; struct errmsg *pe; - char buf[MAXPKTSIZE]; if (error == 0) return ("success"); for (pe = errmsgs; pe->e_code >= 0; pe++) if (pe->e_code == error) return (pe->e_msg); - snprintf(ebuf, sizeof(buf), "error %d", error); + snprintf(ebuf, sizeof(ebuf), "error %d", error); return (ebuf); } Patch attached with submission follows: diff -u -p -r1.8 tftp-io.c --- libexec/tftpd/tftp-io.c 17 Nov 2012 01:50:12 -0000 1.8 +++ libexec/tftpd/tftp-io.c 22 Dec 2012 11:17:19 -0000 @@ -87,14 +87,13 @@ errtomsg(int error) { static char ebuf[40]; struct errmsg *pe; - char buf[MAXPKTSIZE]; if (error == 0) return ("success"); for (pe = errmsgs; pe->e_code >= 0; pe++) if (pe->e_code == error) return (pe->e_msg); - snprintf(ebuf, sizeof(buf), "error %d", error); + snprintf(ebuf, sizeof(ebuf), "error %d", error); return (ebuf); } >Release-Note: >Audit-Trail: >Unformatted: