Re: cppcheck: VDR 1.7.18: [timers.c:53]: (error) snprintf size is out of bounds

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[1] http://cppcheck.sourceforge.net/

_______________________________________________
vdr mailing list
vdr@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr



[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux