Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2248.2254
Procedure: autolog_open
Trace: View
Modified: Wed Sep 2 11:54:34 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 autolog_open
 418 static void autolog_open(SERVER_REC *server, const char *server_tag,
 419                          const char *target) 
 420 {
 421         LOG_REC *log;
 422         char *fname, *dir, *fixed_target, *params;
 423  
 424         log = logs_find_item(LOG_ITEM_TARGET, target, server_tag, NULL);
 425         if (log != NULL && !log->failed) {
 426                 log_start_logging(log);
 427                 return;
 428         }
 429  
 430         /* '/' -> '_' - don't even accidentally try to log to 
 431            #../../../file if you happen to join to such channel..
 432  
 433            '%' -> '%%' - so strftime() won't mess with them */ 
 434         fixed_target = escape_target(target);
 435         if (CHAT_PROTOCOL(server)->case_insensitive)   /* Null Pointer Dereference (ID: 2251.2257) */
 436                 g_strdown(fixed_target);
 437  
 438         /* $0 = target, $1 = server tag */ 
 439         params = g_strconcat(fixed_target, " ", server_tag, NULL);
 440         g_free(fixed_target);
 441  
 442         fname = parse_special_string(autolog_path, server, NULL,
 443                                      params, NULL, 0);
 444         g_free(params);
 445  
 446         if (log_find(fname) == NULL) {
true447                 log = log_create_rec(fname, autolog_level);
 448                 if (!settings_get_bool("autolog_colors"))
 449                         log->colorizer = log_colorizer_strip;   /* Null Pointer Dereference (ID: 2249.2255) */
 450                 log_item_add(log, LOG_ITEM_TARGET, target, server_tag);
 451  
log <= 4095452                 dir = g_path_get_dirname(log->real_fname);     /* Null Pointer Dereference */
Preconditions
&$unknown_808849 != 0
((char*)$param_1)[4] >= 1
((char*)$param_3)[1] = 0
((char*)chat_protocols->data)[4] != 0
((char*)logs->data)[64] != 0
strlen($param_3) = 1
*chat_protocols->data = ((char*)$param_1)[4]
*chat_protocols->data >= 1
Postconditions
strlen(&$unknown_808845)' = 1
((char*)&$unknown_808845)[1]' = 0
fixed_target' = &$unknown_808845
fname' = 0
log' = 0
params' = &$unknown_808847
server' = $param_1
server_tag' = $param_2
target' = $param_3




Change Warning 2248.2254 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: