Text  |   XML   |   Visible Warnings:

Irssi : Irssi analysis 1 : Null Pointer Dereference  at formats.c:649

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2231.2237
Procedure: get_timestamp
Trace: View
Modified: Wed Sep 2 11:53:32 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-common/core/formats.c
   Enter get_timestamp
 621 static char *get_timestamp(THEME_REC *theme, TEXT_DEST_REC *dest, time_t t) 
 622 {
 623         char *format, str[256];
 624         struct tm *tm;
 625         int diff;
 626  
 627         if ((timestamp_level & dest->level) == 0)
 628                 return NULL;
 629  
 630         /* check for flags if we want to override defaults */ 
 631         if (dest->flags & PRINT_FLAG_UNSET_TIMESTAMP)
 632                 return NULL;
 633  
 634         if ((dest->flags & PRINT_FLAG_SET_TIMESTAMP) == 0 &&
 635             (dest->level & (MSGLEVEL_NEVER|MSGLEVEL_LASTLOG)) != 0)
 636                 return NULL;
 637  
 638  
 639         if (timestamp_timeout > 0) {
 640                 diff = t - dest->window->last_timestamp;
 641                 dest->window->last_timestamp = t;
 642                 if (diff < timestamp_timeout)
 643                         return NULL;
 644         }
 645  
 646         tm = localtime(&t);
 647         format = format_get_text_theme(theme, MODULE_NAME, dest,
true648                                        TXT_TIMESTAMP);
format <= 4095649         if (strftime(str, sizeof(str), format, tm) <= 0)     /* Null Pointer Dereference */
Preconditions
timestamp_timeout >= 1
Postconditions
dest' = $param_2
diff' >= 1
diff' >= timestamp_timeout
format' = 0
t' = $param_3
theme' = $param_1
tm' = &tmbuf.tm_sec
tmbuf.tm_sec' = &$unknown_636409




Change Warning 2231.2237 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: