summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ldap/ber.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/ldap/ber.c b/usr.bin/ldap/ber.c
index 286a50d3a47..1402c1b8b70 100644
--- a/usr.bin/ldap/ber.c
+++ b/usr.bin/ldap/ber.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ber.c,v 1.2 2018/06/27 13:22:17 rob Exp $ */
+/* $OpenBSD: ber.c,v 1.3 2018/06/27 20:11:27 rob Exp $ */
/*
* Copyright (c) 2007 Reyk Floeter <reyk@vantronix.net>
@@ -269,7 +269,7 @@ ber_add_nstring(struct ber_element *prev, const char *string0, size_t len)
struct ber_element *elm;
char *string;
- if ((string = calloc(1, len)) == NULL)
+ if ((string = calloc(1, len + 1)) == NULL)
return NULL;
if ((elm = ber_get_element(BER_TYPE_OCTETSTRING)) == NULL) {
free(string);