Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/login Fixed off-by-one in decode_ss (CID 977426)



details:   https://anonhg.NetBSD.org/src/rev/d5aa24d5a556
branches:  trunk
changeset: 811397:d5aa24d5a556
user:      shm <shm%NetBSD.org@localhost>
date:      Wed Oct 28 07:27:24 2015 +0000

description:
Fixed off-by-one in decode_ss (CID 977426)

OK kamil@

diffstat:

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

diffs (27 lines):

diff -r 42ff66cf065c -r d5aa24d5a556 usr.bin/login/common.c
--- a/usr.bin/login/common.c    Wed Oct 28 02:23:50 2015 +0000
+++ b/usr.bin/login/common.c    Wed Oct 28 07:27:24 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: common.c,v 1.7 2015/10/27 14:53:00 shm Exp $   */
+/*     $NetBSD: common.c,v 1.8 2015/10/28 07:27:24 shm Exp $   */
 
 /*-
  * Copyright (c) 1980, 1987, 1988, 1991, 1993, 1994
@@ -29,7 +29,7 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: common.c,v 1.7 2015/10/27 14:53:00 shm Exp $");
+__RCSID("$NetBSD: common.c,v 1.8 2015/10/28 07:27:24 shm Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -390,7 +390,7 @@
        if (len > sizeof(*ssp) * 4 + 1 || len < sizeof(*ssp))
                errx(EXIT_FAILURE, "Bad argument");
 
-       if ((ssp = malloc(len)) == NULL)
+       if ((ssp = malloc(len + 1)) == NULL)
                err(EXIT_FAILURE, NULL);
 
        if (strunvis((char *)ssp, arg) != sizeof(*ssp))



Home | Main Index | Thread Index | Old Index