diff options
author | Atli Guðmundsson <atli@tern.is> | 2018-12-28 15:51:06 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2018-12-28 21:27:12 +0000 |
commit | 46e7148461977914d34f8ade4dc94ad564dedc29 (patch) | |
tree | 7e7ee9c784792092b99d52b54d69fc1472bb4ccc /epan/dissectors | |
parent | 1afe11f0993a4d1bd3e6534172ab9bd04d72ba90 (diff) |
Fixed ASTERIX 6bit callsign decoding
The callsign was being truncated to 7 letters.
This affects the following fields:
- I004/100#01.AN
- I004/170#08.MS1
- I004/170#08.MS2
- I025/020.SD
- asterix.AI, which is included in:
-- I021/170
-- I048/240
-- I062/245
-- I062/380#02
-- I062/380#03_v0_17
Change-Id: Idbbb3891d96e906053fc1f0c447e37bae87d207a
Reviewed-on: https://code.wireshark.org/review/31230
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-asterix.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/epan/dissectors/packet-asterix.c b/epan/dissectors/packet-asterix.c index 2a0ec313f0..2fe4912074 100644 --- a/epan/dissectors/packet-asterix.c +++ b/epan/dissectors/packet-asterix.c @@ -9338,16 +9338,17 @@ static void asterix_build_subtree (tvbuff_t *tvb, packet_info *pinfo, guint offs proto_tree_add_double (parent, *field->part[i]->hf, tvb, offset + inner_offset / 8, byte_length (field->part[i]->bit_length), value * scaling_factor); break; case FIELD_PART_CALLSIGN: - str_buffer = (char *)wmem_alloc (wmem_packet_scope (), 9); - str_buffer[0] = '\0'; - g_snprintf (str_buffer, 8, "%c%c%c%c%c%c%c%c, ", AISCode[(value >> 42) & 63], - AISCode[(value >> 36) & 63], - AISCode[(value >> 30) & 63], - AISCode[(value >> 24) & 63], - AISCode[(value >> 18) & 63], - AISCode[(value >> 12) & 63], - AISCode[(value >> 6) & 63], - AISCode[value & 63]); + str_buffer = wmem_strdup_printf( + wmem_packet_scope (), + "%c%c%c%c%c%c%c%c", + AISCode[(value >> 42) & 63], + AISCode[(value >> 36) & 63], + AISCode[(value >> 30) & 63], + AISCode[(value >> 24) & 63], + AISCode[(value >> 18) & 63], + AISCode[(value >> 12) & 63], + AISCode[(value >> 6) & 63], + AISCode[value & 63]); proto_tree_add_string (parent, *field->part[i]->hf, tvb, offset + inner_offset / 8, byte_length (field->part[i]->bit_length), str_buffer); break; } |