diff options
author | 2014-10-17 08:03:04 +0000 | |
---|---|---|
committer | 2014-10-17 08:03:04 +0000 | |
commit | 50bd0a994ac9fc5eb956ed4499aaacce924b7984 (patch) | |
tree | bdaf65597ded8583313e6a4d49c2a8fb6cc0d1c5 | |
parent | remove -C from usage(); (diff) | |
download | wireguard-openbsd-50bd0a994ac9fc5eb956ed4499aaacce924b7984.tar.xz wireguard-openbsd-50bd0a994ac9fc5eb956ed4499aaacce924b7984.zip |
strvis() requires that the buffer is at least 4 * srclen + 1.
ok deraadt@
-rw-r--r-- | usr.bin/finger/util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/finger/util.c b/usr.bin/finger/util.c index 8edbfa483aa..de2053ee863 100644 --- a/usr.bin/finger/util.c +++ b/usr.bin/finger/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.24 2013/11/26 13:18:55 deraadt Exp $ */ +/* $OpenBSD: util.c,v 1.25 2014/10/17 08:03:04 doug Exp $ */ /* * Copyright (c) 1989 The Regents of the University of California. @@ -393,7 +393,7 @@ vs(struct storage **exist, char *src) char *dst; struct storage *n; - if ((n = malloc(sizeof(struct storage) + 4 * strlen(src))) == NULL) + if ((n = malloc(sizeof(struct storage) + 4 * strlen(src) + 1)) == NULL) err(1, "malloc failed"); n->next = *exist; *exist = n; |