Text  |   XML   |   Visible Warnings:

Irssi : Irssi analysis 1 : Null Pointer Dereference  at fe-log.c:305

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2246.2252
Procedure: cmd_window_log
Trace: View
Modified: Wed Sep 2 11:54: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/fe-log.c
   Enter cmd_window_log
 271 static void cmd_window_log(const char *data) 
 272 {
 273         LOG_REC *log;
 274         char *set, *fname, window[MAX_INT_STRLEN];
 275         void *free_arg;
 276         int open_log, close_log;
 277  
 278         if (!cmd_get_params(data, &free_arg, 2, &set, &fname))
 279                 return;
 280  
 281         ltoa(window, active_win->refnum);
 282         log = logs_find_item(LOG_ITEM_WINDOW_REFNUM, window, NULL, NULL);
 283  
 284         open_log = close_log = FALSE;
 285         if (g_ascii_strcasecmp(set, "ON") == 0)
 286                 open_log = TRUE;
 287         else if (g_ascii_strcasecmp(set, "OFF") == 0) {
 288                 close_log = TRUE;
 289         } else if (g_ascii_strcasecmp(set, "TOGGLE") == 0) {
 290                 open_log = log == NULL;
 291                 close_log = log != NULL;
 292         } else {
 293                 printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, TXT_NOT_TOGGLE);
 294                 cmd_params_free(free_arg);
 295                 return;
 296         }
 297  
 298         if (open_log && log == NULL) {
 299                 /* irc.log.<windowname> or irc.log.Window<ref#> */ 
 300                 fname = *fname != '\0' ? g_strdup(fname) : 
 301                         g_strdup_printf("~/irc.log.%s%s",
 302                                         active_win->name != NULL ? active_win->name : "Window",
 303                                         active_win->name != NULL ? "" : window);
true304                 log = log_create_rec(fname, MSGLEVEL_ALL);
log <= 4095305                 log->colorizer = log_colorizer_strip;     /* Null Pointer Dereference */
Preconditions
$param_1 != 0
&$unknown_802556 != 0
&$unknown_802557 != 0
logs >= 0
Postconditions
close_log' = 0
data' = $param_1
fname' = 0
log' = 0
open_log' = 1
set' = &$unknown_802555




Change Warning 2246.2252 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: