packet-gmr1_bcch: Add guards in the SI1/2 choice of segment

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.

svn path=/trunk/; revision=44674
This commit is contained in:
Pascal Quantin 2012-08-25 21:31:29 +00:00
parent f783da2d6d
commit 1c76cb5fef
1 changed files with 2 additions and 0 deletions

View File

@ -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