diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2017-02-19 21:41:55 +0100 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2017-02-20 13:19:47 +0000 |
commit | 1089211c0b0aca7d95b4f54ca0e61d070555e896 (patch) | |
tree | 3d53f13aca68eb3b85f796ba87e4b439e34972f1 /epan/dissectors/asn1/snmp | |
parent | e2e4415c9fefbe3c8b840c3207c8e1197e9b385e (diff) |
SNMP: duplicate dynamic members of snmp_ue_assoc_t structure in localize_ue()
Otherwise you can end up freeing twice the same memory blocks
(from localized_ues and unlocalized_ues lists)
Bug: 13420
Change-Id: I7e6f1f8d740b0e5ffca851f3f5b1928a7686c069
Reviewed-on: https://code.wireshark.org/review/20190
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan/dissectors/asn1/snmp')
-rw-r--r-- | epan/dissectors/asn1/snmp/packet-snmp-template.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/epan/dissectors/asn1/snmp/packet-snmp-template.c b/epan/dissectors/asn1/snmp/packet-snmp-template.c index 3665a761fd..3ee10c4fc0 100644 --- a/epan/dissectors/asn1/snmp/packet-snmp-template.c +++ b/epan/dissectors/asn1/snmp/packet-snmp-template.c @@ -1467,6 +1467,11 @@ localize_ue( snmp_ue_assoc_t* o, const guint8* engine, guint engine_len ) { snmp_ue_assoc_t* n = (snmp_ue_assoc_t*)g_memdup(o,sizeof(snmp_ue_assoc_t)); + n->user.userName.data = (guint8*)g_memdup(o->user.userName.data,o->user.userName.len); + n->user.authPassword.data = (guint8*)g_memdup(o->user.authPassword.data,o->user.authPassword.len); + n->user.privPassword.data = (guint8*)g_memdup(o->user.privPassword.data,o->user.privPassword.len); + n->user.authKey.data = (guint8*)g_memdup(o->user.authKey.data,o->user.authKey.len); + n->user.privKey.data = (guint8*)g_memdup(o->user.privKey.data,o->user.privKey.len); n->engine.data = (guint8*)g_memdup(engine,engine_len); n->engine.len = engine_len; |