diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-10-29 20:41:30 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-10-29 20:41:30 +0000 |
commit | 27928affd6ce5ef133f536fc42230cdc7b882e34 (patch) | |
tree | 774c80c948787e4b1e8b26355bced805e07fd674 /epan/dissectors/packet-cip.c | |
parent | c1d710b46750b9792cf5d741bab8341b242a24d9 (diff) |
Don't set mr_mult_req_info->num_services *unless we're sure
mr_mult_req_info is non-null*! This should fix bug 6514, and possibly a
bunch of other buildbot crashes.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39667 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-cip.c')
-rw-r--r-- | epan/dissectors/packet-cip.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/epan/dissectors/packet-cip.c b/epan/dissectors/packet-cip.c index fb851cfb40..28b90df5a2 100644 --- a/epan/dissectors/packet-cip.c +++ b/epan/dissectors/packet-cip.c @@ -3250,20 +3250,20 @@ dissect_cip_multiple_service_packet_req(tvbuff_t *tvb, packet_info *pinfo, proto mr_single_req_info->ciaData = NULL; dissect_cip_data(mult_serv_tree, next_tvb, 0, pinfo, mr_single_req_info ); + + /* Don't set mr_mult_req_info->num_services until we're sure we've + * initialized the full structure for that service. Otherwise if we + * happen to throw an exception here (before initializing the whole + * structure), we'll core someplace (like + * dissect_cip_generic_service_rsp()) which expects all num_services + * entries to be fully initialized. + */ + mr_mult_req_info->num_services = i+1; } else { dissect_cip_data(mult_serv_tree, next_tvb, 0, pinfo, NULL ); } - - /* Don't set mr_mult_req_info->num_services until we're sure we've - * initialized the full structure for that service. Otherwise if we - * happen to throw an exception here (before initializing the whole - * structure), we'll core someplace (like - * dissect_cip_generic_service_rsp()) which expects all num_services - * entries to be fully initialized. - */ - mr_mult_req_info->num_services = i+1; } } |