ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: [Wireshark-dev] BCD Decoding

From: Evan Huus <eapache@xxxxxxxxx>
Date: Tue, 17 Dec 2013 17:56:32 -0500
Alexis's ASAN build recently caught an error in
tvb_bcd_dig_to_wmem_packet_str in which it appears that if the least
significant nibble of the decoded byte is 0xf then we read one element
past the end of the 14-element digit array.

If the most significant nibble is 0xf we treat that as a stop
condition. Is the correct approach to treat a least significant nibble
of 0xf as a stop condition also?

While in the neighbourhood - shouldn't we be decoding the more
significant nibble first, not second? Wiki states that most BCD
implementations are big-endian...

Cheers,
Evan