diff options
author | Guy Harris <guy@alum.mit.edu> | 2011-10-29 20:41:30 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2011-10-29 20:41:30 +0000 |
commit | f15386dd9319dc31b1c4151a8ef1281b07f26c58 (patch) | |
tree | 774c80c948787e4b1e8b26355bced805e07fd674 /epan/dissectors/packet-cip.c | |
parent | be353072dcbc2868a534844325d0678f69a6c58a (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.
svn path=/trunk/; revision=39667
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; } } |