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.

        […]
        cTimer::cTimer(bool Instant, bool Pause, cChannel *Channel)
        {
          startTime = stopTime = 0;
          lastSetEvent = 0;
          recording = pending = inVpsMargin = false;
          flags = tfNone;
          if (Instant)
             SetFlags(tfActive | tfInstant);
          channel = Channel ? Channel : 
Channels.GetByNumber(cDevice::CurrentChannel());
          time_t t = time(NULL);
          struct tm tm_r;
          struct tm *now = localtime_r(&t, &tm_r);
          day = SetTime(t, 0);
          weekdays = 0;
          start = now->tm_hour * 100 + now->tm_min;
          stop = now->tm_hour * 60 + now->tm_min + Setup.InstantRecordTime;
          stop = (stop / 60) * 100 + (stop % 60);
          if (stop >= 2400)
             stop -= 2400;
          priority = Pause ? Setup.PausePriority : Setup.DefaultPriority;
          lifetime = Pause ? Setup.PauseLifetime : Setup.DefaultLifetime;
          *file = 0;
          aux = NULL;
          event = NULL;
          if (Instant && channel)
             snprintf(file, sizeof(file), "%s%s", Setup.MarkInstantRecord ? "@" 
: "", *Setup.NameInstantRecord ? Setup.NameInstantRecord : channel->Name());
        […]

Unfortunately I do not know C++ well enough to judge this error message.


Thanks,

Paul


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

Attachment: signature.asc
Description: This is a digitally signed message part

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

Reply via email to