Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2342.2352
Procedure: strip_codes
Trace: View
Modified: Wed Sep 2 12:17:55 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-text/statusbar.c
   Enter statusbar_item_default_handler
 666 void statusbar_item_default_handler(SBAR_ITEM_REC *item, int get_size_only,
 667                                     const char *str, const char *data,
 668                                     int escape_vars) 
 669 {
 670         SERVER_REC *server;
 671         WI_ITEM_REC *wiitem;  
 672         char *tmpstr, *tmpstr2;
 673         int len;
 674  
 675         if (str == NULL)
 676                 str = statusbar_item_get_value(item);
 677         if (str == NULL || *str == '\0') {
 678                 item->min_size = item->max_size = 0;
 679                 return;
 680         }
 681  
 682         if (active_win == NULL) {
 683                 server = NULL;
 684                 wiitem = NULL;
 685         } else {
 686                 server = active_win->active_server != NULL ? 
 687                         active_win->active_server : active_win->connect_server;
 688                 wiitem = active_win->active;
 689         }
 690  
 691         /* expand templates */ 
 692         tmpstr = theme_format_expand_data(current_theme, &str,
 693                                           'n', 'n',
 694                                           NULL, NULL,
 695                                           EXPAND_FLAG_ROOT | 
 696                                           EXPAND_FLAG_IGNORE_REPLACES | 
 697                                           EXPAND_FLAG_IGNORE_EMPTY);
 698         /* expand $variables */ 
 699         tmpstr2 = parse_special_string(tmpstr, server, wiitem, data, NULL,
true700                                        (escape_vars ? PARSE_FLAG_ESCAPE_VARS : 0 ));
 701         g_free(tmpstr);
 702  
 703         /* remove color codes (not %formats) */ 
tmpstr2 <= 4095704         tmpstr = strip_codes(tmpstr2);
     /u1/paul/SATE/2010/c/irssi/irssi-0.8.14/src/fe-common/core/formats.c
     Enter statusbar_item_default_handler / strip_codes
$param_1 <= 4095886   char *strip_codes(const char *input) 
 887   {
 888           const char *p;
 889           char *str, *out;
 890    
 891           out = str = g_strdup(input);
input <= 4095892           for (p = input; *p != '\0'; p++) {     /* Null Pointer Dereference */  /* Null Pointer Dereference (ID: 2234.2240) */
     Exit statusbar_item_default_handler / strip_codes
Preconditions
$param_3 = 0
$param_5 != 0
&$unknown_2901132 = 0
&$unknown_2901133 = 0
((char*)&((char*)*$param_1)[8])[8] = 0
active_win->active_server = 0
$unknown_2901126 != 0
strlen(&$unknown_2901126) != 0
Postconditions
data' = $param_4
escape_vars' = $param_5
get_size_only' = $param_2
input' = 0
item' = $param_1
p' = 0
server' = active_win->connect_server
str' = out'
tmpstr' = 0
tmpstr2' = 0
wiitem' = active_win->active




Change Warning 2342.2352 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: