artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b30bd43
)
Fix a potential mem-leak in usm_decrypt().
author
gerhard
<gerhard@openbsd.org>
Mon, 8 May 2023 12:25:23 +0000
(12:25 +0000)
committer
gerhard
<gerhard@openbsd.org>
Mon, 8 May 2023 12:25:23 +0000
(12:25 +0000)
Spotted by hshoexer@
ok martijn@
usr.sbin/snmpd/usm.c
patch
|
blob
|
history
diff --git
a/usr.sbin/snmpd/usm.c
b/usr.sbin/snmpd/usm.c
index
1ced2fd
..
a3df1ac
100644
(file)
--- a/
usr.sbin/snmpd/usm.c
+++ b/
usr.sbin/snmpd/usm.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: usm.c,v 1.2
5 2022/12/20 20:01:25 martijn
Exp $ */
+/* $OpenBSD: usm.c,v 1.2
6 2023/05/08 12:25:23 gerhard
Exp $ */
/*
* Copyright (c) 2012 GeNUA mbH
@@
-629,8
+629,10
@@
usm_decrypt(struct snmp_message *msg, struct ber_element *encr)
return NULL;
scoped_pdu_len = usm_crypt(msg, privstr, (int)privlen, buf, 0);
- if (scoped_pdu_len < 0)
+ if (scoped_pdu_len < 0) {
+ free(buf);
return NULL;
+ }
bzero(&ber, sizeof(ber));
ober_set_application(&ber, smi_application);