On 15.06.2011 15:30, Paul Menzel wrote:
Dear VDR folks,
Cppcheck 1.49 [1] reports the following error when run against VDR 1.7.18.
[timers.c:53]: (error) snprintf size is out of bounds
Looking at `timers.c` in `CTimer` `*file = 0` and afterward written to if I am not mistaken.
This just sets the string to be "empty", but...
[…] cTimer::cTimer(bool Instant, bool Pause, cChannel *Channel) { ... *file = 0; aux = NULL; event = NULL; if (Instant&& channel) snprintf(file, sizeof(file), "%s%s", Setup.MarkInstantRecord ? "@" : "", *Setup.NameInstantRecord ? Setup.NameInstantRecord : channel->Name());
...this should be
sizeof(file) - 1
Thanks for the bug report.
Klaus
[…]
Unfortunately I do not know C++ well enough to judge this error message.
Thanks,
Paul