diff options
author | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2012-04-28 23:58:06 +0000 |
---|---|---|
committer | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2012-04-28 23:58:06 +0000 |
commit | b77cd5d0f4fa284c9fe33369e95cb6fe4a46b771 (patch) | |
tree | 92d2a5f77ab54354927a3cf6b5888a63c1c3b21b /epan/dissectors/packet-catapult-dct2000.c | |
parent | b9677f575cb072acce45fbe116b803a1d4abff60 (diff) |
Check result of sscanf(), and avoid a mirrored variable declaration.
From Visual Studio Analyzer output.
svn path=/trunk/; revision=42327
Diffstat (limited to 'epan/dissectors/packet-catapult-dct2000.c')
-rw-r--r-- | epan/dissectors/packet-catapult-dct2000.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/epan/dissectors/packet-catapult-dct2000.c b/epan/dissectors/packet-catapult-dct2000.c index ea9e5ebe63..d900c07b60 100644 --- a/epan/dissectors/packet-catapult-dct2000.c +++ b/epan/dissectors/packet-catapult-dct2000.c @@ -2010,7 +2010,11 @@ static void check_for_oob_mac_lte_events(packet_info *pinfo, tvbuff_t *tvb, prot } /* Read this entry */ - sscanf(current_position, "[UE=%u][RNTI=%u]", &ueids[n], &rntis[n]); + if (sscanf(current_position, "[UE=%u][RNTI=%u]", &ueids[n], &rntis[n]) != 2) { + /* Assuming that if we can't read this one there is no point trying others */ + number_of_ues = n; + break; + } } } } @@ -2478,7 +2482,6 @@ dissect_catapult_dct2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) "User%%=%d Sys%%=%d Load%%=%d", &user_cpu, &sys_cpu, &load_cpu); if (matched == 3) { - proto_item *ti; ti = proto_tree_add_uint(tree, hf_catapult_dct2000_lte_monitor_cpu_user, tvb, 0, 0, user_cpu); PROTO_ITEM_SET_GENERATED(ti); |