diff options
author | rob <rob@cvs.openbsd.org> | 2018-06-27 20:11:28 +0000 |
---|---|---|
committer | rob <rob@cvs.openbsd.org> | 2018-06-27 20:11:28 +0000 |
commit | f3da76155dc6796dc02dd3477b117d73bd61fb8c (patch) | |
tree | 0a429185c8ba653635ccde4267977de2ee8e01cb /usr.bin/ldap | |
parent | 7440a7b433f83eaea2ebe86791fccdc21d809f50 (diff) |
Consistent use of calloc in ber.c.
Ok claudio@, "looks right" gsoares@
Diffstat (limited to 'usr.bin/ldap')
-rw-r--r-- | usr.bin/ldap/ber.c | 4 |
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); |