The first printf also has this problem:
if hour, min or sec is >= 100 we can overflow duration_str
Also use %u for hours as it can be >= 100
In file included from ./bitstream/dvb/si_print.h:35:0,
from dvb_print_si.c:42:
dvb_print_si.c: In function ‘handle_section’:
./bitstream/dvb/si/eit_print.h:108:42: warning: ‘%02d’ directive writing between 2 and 3 bytes into a region of size between 2 and 4 [-Wformat-overflow=]
sprintf(duration_str, "%02d:%02d:%02d", hour, min, sec);
^~~~
./bitstream/dvb/si/eit_print.h:108:31: note: directive argument in the range [0, 165]
sprintf(duration_str, "%02d:%02d:%02d", hour, min, sec);
^~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:862:0,
from dvb_print_si.c:33:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:33:10: note: ‘__builtin___sprintf_chk’ output between 9 and 12 bytes into a destination of size 10
return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I have been looking at implementing support for parsing the LCN
descriptor for UK DVB-T and to my supprise most of it was already there
but for a different standard. In the D-Book LCN is tag 0x83 with private
data specifier of 0x233a where as what is currently implented is the
IEC/CENELEC 62 216 standard where the only difference (in the actual
data) is the latter has 1 bit that specifies if the channel is vissible
or not and the private data specifier is 0x0028.
Some fields in BAT, RST and SIT have been renamed to match the same name (for
the exact same purpose) in SDT. DVBlast is not impacted but other
applications may have to be changed.
BAT: table ID extension is a bouquet ID, not a network ID.
Correct handling of EIT (service-specific) and BAT (bouquet-specific) in
dvb_print_si. Also free all allocated structures so that we now pass
valgrind memcheck.