forked from osmocom/wireshark
ntp: remove size constraint for invalid refid.
When the refid contains non-ascii chars, the conversion function returns a string longer than 4 chars. This results in an invalid string if the output is limited to 4 bytes. Incidentally this results in an invalid PDML output as well that caught this bug in the first place. Fix: #17112.
This commit is contained in:
parent
564a52be19
commit
39da36ad6e
|
@ -1254,7 +1254,7 @@ dissect_ntp_std(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ntp_tree, ntp_con
|
|||
*/
|
||||
buff = (gchar *)wmem_alloc(wmem_packet_scope(), NTP_TS_SIZE);
|
||||
if (stratum <= 1) {
|
||||
g_snprintf (buff, NTP_TS_SIZE, "Unidentified reference source '%.4s'",
|
||||
g_snprintf (buff, NTP_TS_SIZE, "Unidentified reference source '%s'",
|
||||
tvb_get_string_enc(wmem_packet_scope(), tvb, 12, 4, ENC_ASCII));
|
||||
for (i = 0; primary_sources[i].id; i++) {
|
||||
if (tvb_memeql(tvb, 12, primary_sources[i].id, 4) == 0) {
|
||||
|
|
Loading…
Reference in New Issue