Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/apropos Fix buffer overflow. We don't really care ab...



details:   https://anonhg.NetBSD.org/src/rev/51e55d9dd90c
branches:  trunk
changeset: 584447:51e55d9dd90c
user:      elad <elad%NetBSD.org@localhost>
date:      Sat Sep 17 19:18:31 2005 +0000

description:
Fix buffer overflow. We don't really care about trimming the filename here.
PR/28739, from Michael Santos.

diffstat:

 usr.bin/apropos/apropos.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 1b9a520dbc3e -r 51e55d9dd90c usr.bin/apropos/apropos.c
--- a/usr.bin/apropos/apropos.c Sat Sep 17 16:52:02 2005 +0000
+++ b/usr.bin/apropos/apropos.c Sat Sep 17 19:18:31 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: apropos.c,v 1.25 2005/02/17 16:53:45 xtraeme Exp $     */
+/*     $NetBSD: apropos.c,v 1.26 2005/09/17 19:18:31 elad Exp $        */
 
 /*
  * Copyright (c) 1987, 1993, 1994
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "@(#)apropos.c  8.8 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: apropos.c,v 1.25 2005/02/17 16:53:45 xtraeme Exp $");
+__RCSID("$NetBSD: apropos.c,v 1.26 2005/09/17 19:18:31 elad Exp $");
 #endif
 #endif /* not lint */
 
@@ -154,7 +154,7 @@
                        *end++ = '\0';
 
                if (buildpath) {
-                       (void)sprintf(hold, "%s/%s", name, _PATH_WHATIS);
+                       (void)snprintf(hold, sizeof(hold), "%s/%s", name, _PATH_WHATIS);
                        name = hold;
                }
 



Home | Main Index | Thread Index | Old Index