| Summary: | [libexec] [patch] Sizeof ebuf is wrong in tftp-io.c . | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | henning.petersen | ||||
| Component: | bin | Assignee: | Antoine Brodin <antoine> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | Unspecified | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
Responsible Changed From-To: freebsd-bugs->antoine Take. Author: antoine Date: Tue Dec 25 17:06:05 2012 New Revision: 244686 URL: http://svnweb.freebsd.org/changeset/base/244686 Log: Use correct size in snprintf. Remove unused buffer. PR: 174631 Submitted by: Henning Petersen MFC after: 1 month Modified: head/libexec/tftpd/tftp-io.c Modified: head/libexec/tftpd/tftp-io.c ============================================================================== --- head/libexec/tftpd/tftp-io.c Tue Dec 25 16:44:50 2012 (r244685) +++ head/libexec/tftpd/tftp-io.c Tue Dec 25 17:06:05 2012 (r244686) @@ -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); } _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" State Changed From-To: open->patched Patched in head. Author: antoine Date: Sat Feb 2 13:47:34 2013 New Revision: 246253 URL: http://svnweb.freebsd.org/changeset/base/246253 Log: MFC r244686 to stable/9: Use correct size in snprintf. Remove unused buffer. PR: 174631 Submitted by: Henning Petersen Modified: stable/9/libexec/tftpd/tftp-io.c Directory Properties: stable/9/libexec/tftpd/ (props changed) Modified: stable/9/libexec/tftpd/tftp-io.c ============================================================================== --- stable/9/libexec/tftpd/tftp-io.c Sat Feb 2 12:52:43 2013 (r246252) +++ stable/9/libexec/tftpd/tftp-io.c Sat Feb 2 13:47:34 2013 (r246253) @@ -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); } _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" State Changed From-To: patched->closed Patch committed in head and stable/9, thanks! Author: marius Date: Sat Mar 2 17:18:38 2013 New Revision: 247646 URL: http://svnweb.freebsd.org/changeset/base/247646 Log: MFC: r244686 Use correct size in snprintf. Remove unused buffer. PR: 174631 Submitted by: Henning Petersen Modified: stable/8/libexec/tftpd/tftp-io.c Directory Properties: stable/8/libexec/tftpd/ (props changed) Modified: stable/8/libexec/tftpd/tftp-io.c ============================================================================== --- stable/8/libexec/tftpd/tftp-io.c Sat Mar 2 17:14:53 2013 (r247645) +++ stable/8/libexec/tftpd/tftp-io.c Sat Mar 2 17:18:38 2013 (r247646) @@ -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); } _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" |
Sieof ebuf is wrong, sizeof buf is used. 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: