Text  |   XML   |   Visible Warnings:

irssi-0.8.14 : irssi-0.8.14 analysis 2 : Null Pointer Dereference  at log.c:323

Categories: LANG.MEM.NPD CWE:476
Warning ID: 7315.28407
Procedure: log_find
Trace: view
Modified: Thu Nov 26 11:09:28 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
   /kat0/fletcher/SATE/2010/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: 7316.28408) */
 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,
true443                                      params, NULL, 0);
 444         g_free(params);
 445  
fname <= 4095446         if (log_find(fname) == NULL) {
     /kat0/fletcher/SATE/2010/irssi-0.8.14/src/core/log.c
     Enter autolog_open / log_find
 316   LOG_REC *log_find(const char *fname) 
 317   {
 318           GSList *tmp;
 319    
 320           for (tmp = logs; tmp != NULL; tmp = tmp->next) {
 321                   LOG_REC *rec = tmp->data;
 322    
fname <= 4095323                   if (strcmp(rec->fname, fname) == 0)     /* Null Pointer Dereference */
     Exit autolog_open / log_find
Preconditions
fname[4] >= 1
((char*)$param_3)[1] = 0
((char*)chat_protocols->data)[4] != 0
((char*)logs->data)[32] != 0
strlen($param_3) = 1
*((char*)*logs->data)[20] = 0
*chat_protocols->data = fname[4]
*chat_protocols->data >= 1
autolog_path = 0
Postconditions
strlen(&$unknown_502436)' = 2
((char*)&$unknown_502436)[2]' = 0
((char*)&$unknown_502436)[1]' = 37
fixed_target' = &$unknown_502436
fname' = 0
fname' = 0
log' = logs->data
params' = &$unknown_502437
rec' = logs->data
tmp' = logs




Change Warning 7315.28407 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: