diff options
author | steve <steve@FreeBSD.org> | 1998-06-14 16:03:40 +0000 |
---|---|---|
committer | steve <steve@FreeBSD.org> | 1998-06-14 16:03:40 +0000 |
commit | 32510ecfb57c6446146752faf7655c9506b81f55 (patch) | |
tree | bec354d9190fb622fb22d0d5c41d881534603f45 /usr.bin/more/prim.c | |
parent | a90040b583bb2b134bd685c9f4b7ac1d187f26a6 (diff) | |
download | FreeBSD-src-32510ecfb57c6446146752faf7655c9506b81f55.zip FreeBSD-src-32510ecfb57c6446146752faf7655c9506b81f55.tar.gz |
sprintf -> snprintf to avoid potential buffer overflow.
PR: 6907
Submitted by: Archie Cobbs <archie@whistle.com>
Diffstat (limited to 'usr.bin/more/prim.c')
-rw-r--r-- | usr.bin/more/prim.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/more/prim.c b/usr.bin/more/prim.c index adb17d1..1a571e6 100644 --- a/usr.bin/more/prim.c +++ b/usr.bin/more/prim.c @@ -374,8 +374,8 @@ jump_back(n) while ((c = ch_forw_get()) != '\n') if (c == EOI) { char message[40]; - (void)sprintf(message, "File has only %d lines", - nlines - 1); + (void)snprintf(message, sizeof(message), + "File has only %d lines", nlines - 1); error(message); return; } |