diff options
author | Sylvain Munaut <tnt@246tNt.com> | 2012-08-25 17:56:40 +0200 |
---|---|---|
committer | Sylvain Munaut <tnt@246tNt.com> | 2012-08-25 17:56:40 +0200 |
commit | 3cdd0042814322252c8a4863ff095604c56c4e48 (patch) | |
tree | 11ae89520f28668c98669d36f4b700d704796a7c | |
parent | beb02df3617da33f1b05292b7f26737f16dcf0ae (diff) |
packet-gmr1_bcch: Add guards in the SI1/2 choice of segmentsylvain/gmr
Although the CSN1 dissector itself will just stop if there is
no matching segment, it will leave the choice field uninitizalized
and so when we use it to fill some other text, it crashes ...
To protect against that, we put a last choice entry that will always
match. As a bonus, it triggers an explicit error in CSN so you
know something is wrong.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
-rw-r--r-- | epan/dissectors/packet-gmr1_bcch.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/epan/dissectors/packet-gmr1_bcch.c b/epan/dissectors/packet-gmr1_bcch.c index 991d5472f3..9fe8afd912 100644 --- a/epan/dissectors/packet-gmr1_bcch.c +++ b/epan/dissectors/packet-gmr1_bcch.c @@ -884,6 +884,7 @@ CSN_ChoiceElement_t SI1_SegmentChoice[] = {7, 0x68, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4I, Segment4I_t, "Segment 4I")}, {7, 0x69, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4J, Segment4J_t, "Segment 4J")}, {7, 0x6a, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4K, Segment4K_t, "Segment 4K")}, + {0, 0x00, 1, CSN_ERROR(SystemInformation1_t, "Unknown segment !", -1)}, }; static const @@ -910,6 +911,7 @@ CSN_ChoiceElement_t SI2_SegmentChoice[] = {5, 0x04, 1, M_TYPE_LABEL(SystemInformation2_t, u.Segment3E, Segment3E_t, "Segment 3E")}, {5, 0x06, 1, M_TYPE_LABEL(SystemInformation2_t, u.Segment3G, Segment3G_t, "Segment 3G")}, {5, 0x0a, 1, M_TYPE_LABEL(SystemInformation2_t, u.Segment3J, Segment3J_t, "Segment 3J")}, + {0, 0x00, 1, CSN_ERROR(SystemInformation2_t, "Unknown segment !", -1)}, }; static const |