Text  |   XML   |   Visible Warnings:

Irssi : Irssi analysis 1 : Null Pointer Dereference  at log.c:323

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2250.2256
Procedure: log_find
Trace: View
Modified: Wed Sep 2 11:54:35 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,
true443                                      params, NULL, 0);
 444         g_free(params);
 445  
fname <= 4095446         if (log_find(fname) == NULL) {
     /u1/paul/SATE/2010/c/irssi/irssi-0.8.14/src/core/log.c
     Enter autolog_open / log_find
$param_1 <= 4095316   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
((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
*((char*)*logs->data)[40] = 0
**logs->data = 0
strlen(*logs->data) = 0
*chat_protocols->data = ((char*)$param_1)[4]
*chat_protocols->data >= 1
autolog_path = 0
Postconditions
strlen(&$unknown_809964)' = 2
((char*)&$unknown_809964)[2]' = 0
((char*)&$unknown_809964)[1]' = 37
fixed_target' = &$unknown_809964
fname' = 0
fname' = 0
log' = logs->data
params' = &$unknown_809967
rec' = logs->data
server' = $param_1
server_tag' = $param_2
target' = $param_3
tmp' = logs




Change Warning 2250.2256 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: