Text  |   XML   |   Visible Warnings:

Irssi : Irssi analysis 1 : Buffer Overrun  at textbuffer-commands.c:201

Categories: LANG.MEM.BO CWE:120 CWE:121 CWE:122 CWE:126
Warning ID: 2394.2408
Similar Warnings: 2394.2406, 2394.2407
Procedure: scrollback_goto_time
Trace: View
Modified: Wed Sep 2 12:24:13 2009   show details
 
Priority: None
State: None
Finding: None
Owner: None
  edit properties

Legend [ X ]
Warning Location
Contributes
Parse Error
Other Warning
Two or More Loop Iterations
On Execution Path
Comment
Macro
Preprocessor
Include
Keyword
Preprocessed Away

Source  |  Language: C Hide Legend     
ProblemLineSource
   /u1/paul/SATE/2010/c/irssi/irssi-0.8.14/src/fe-text/textbuffer-commands.c
   Enter scrollback_goto_time
 186 static void scrollback_goto_time(const char *datearg, const char *timearg) 
 187 {
 188         LINE_REC *line;
 189         struct tm tm;
 190         time_t now, stamp;
 191         int day, month;
 192  
 193         /* [dd[.mm] | -<days ago>] hh:mi[:ss] */ 
 194         now = stamp = time(NULL);
 195         if (*datearg == '-') {
 196                 /* -<days ago> */ 
 197                 stamp -= atoi(datearg+1) * 3600*24;
 198                 memcpy(&tm, localtime(&stamp), sizeof(struct tm));   /* Buffer Overrun (ID: 2394.2407) */
 199         } else if (*timearg != '\0') {
 200                 /* dd[.mm] */ 
true201                 memcpy(&tm, localtime(&stamp), sizeof(struct tm));     /* Buffer Overrun */
Preconditions
&$unknown_3432756 = 56
*$param_1 != 45
*$param_2 != 0
strlen($param_2) != 0
Postconditions
datearg' = $param_1
stamp' = now'
timearg' = $param_2
tm.tm_sec' = &$unknown_3432755
tmbuf.tm_sec' = &$unknown_3432755




Change Warning 2394.2408 : Buffer Overrun

Because they are very similar, this warning shares annotations with warnings 2394.2406 and 2394.2407.
CodeSonar has selected warning 2394.2406 to represent this group of similar warnings. In order to edit this group, you must edit warning 2394.2406.