Date: Sat, 22 Dec 2012 12:37:09 GMT From: Henning Petersen <henning.petersen@t-online.de> To: freebsd-gnats-submit@FreeBSD.org Subject: bin/174631: Sizeof ebuf is wrong in tftp-io.c . Message-ID: <201212221237.qBMCb9Ux011779@red.freebsd.org> Resent-Message-ID: <201212221240.qBMCe01q022727@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212221237.qBMCb9Ux011779>