diff options
author | martijn <martijn@openbsd.org> | 2018-11-20 07:20:21 +0000 |
---|---|---|
committer | martijn <martijn@openbsd.org> | 2018-11-20 07:20:21 +0000 |
commit | 6b0574aedca612fbd89b416bdf7ec02c63c9a0af (patch) | |
tree | c619f92fc142ecb2e01f67bae1ad4b194998df30 /usr.sbin/ldapd | |
parent | Fix the case where the recursion detection isn't reset when the command is (diff) | |
download | wireguard-openbsd-6b0574aedca612fbd89b416bdf7ec02c63c9a0af.tar.xz wireguard-openbsd-6b0574aedca612fbd89b416bdf7ec02c63c9a0af.zip |
Fix when ber_free_elements is called with a NULL-value.
Found via snmpctl snmp walk 127.0.0.1 oid 1
OK claudio@
Diffstat (limited to 'usr.sbin/ldapd')
-rw-r--r-- | usr.sbin/ldapd/ber.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/ldapd/ber.c b/usr.sbin/ldapd/ber.c index b76fa45a7d2..a914ce80ff1 100644 --- a/usr.sbin/ldapd/ber.c +++ b/usr.sbin/ldapd/ber.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ber.c,v 1.29 2018/08/12 22:04:09 rob Exp $ */ +/* $OpenBSD: ber.c,v 1.30 2018/11/20 07:20:21 martijn Exp $ */ /* * Copyright (c) 2007, 2012 Reyk Floeter <reyk@openbsd.org> @@ -894,6 +894,8 @@ ber_free_element(struct ber_element *root) void ber_free_elements(struct ber_element *root) { + if (root == NULL) + return; if (root->be_sub && (root->be_encoding == BER_TYPE_SEQUENCE || root->be_encoding == BER_TYPE_SET)) ber_free_elements(root->be_sub); |