Text  |   XML   |   Visible Warnings:

Irssi : Irssi analysis 1 : Null Pointer Dereference  at textbuffer-view.c:176

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2355.2366
Procedure: view_update_line_cache
Trace: View
Modified: Wed Sep 2 12:19:45 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/perl/textui/TextBufferView.c
   Enter XS_Irssi__TextUI__TextBufferView_get_line_cache
 149 XS(XS_Irssi__TextUI__TextBufferView_get_line_cache) 
 150 {
 151 #ifdef dVAR 
 152     dVAR; dXSARGS;
 153 #else 
 154     dXSARGS; 
 155 #endif 
 156     if (items != 2)
 157        Perl_croak(aTHX_ "Usage: %s(%s)", "Irssi::TextUI::TextBufferView::get_line_cache", "view, line");
 158     PERL_UNUSED_VAR(cv); /* -W */ 
 159     {
 160         Irssi__TextUI__TextBufferView   view = irssi_ref_object(ST(0));
true161         Irssi__TextUI__Line     line = irssi_ref_object(ST(1));
 162         Irssi__TextUI__LineCache        RETVAL;
 163  
line = 0164         RETVAL = textbuffer_view_get_line_cache(view, line);
     /u1/paul/SATE/2010/c/irssi/irssi-0.8.14/src/fe-text/textbuffer-view.c
     Enter XS_Irssi__TextUI__TextBufferView_get_line_cache / textbuffer_view_get_line_cache
 893   LINE_CACHE_REC *textbuffer_view_get_line_cache(TEXT_BUFFER_VIEW_REC *view,
$param_2 = 0894                                                  LINE_REC *line) 
 895   {
 896           LINE_CACHE_REC *cache;
 897    
 898           g_assert(view != NULL);
line = 0899           g_assert(line != NULL);
 900    
 901           cache = g_hash_table_lookup(view->cache->line_cache, line);   /* Null Pointer Dereference (ID: 2356.2367) */
 902           if (cache == NULL)
line <= 4095903                   cache = view_update_line_cache(view, line);
       Enter XS_Irssi__TextUI__TextBufferView_get_line_cache / textbuffer_view_get_line_cache / view_update_line_cache
 164     static LINE_CACHE_REC * 
$param_2 <= 4095165     view_update_line_cache(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line) 
 166     {
 167             INDENT_FUNC indent_func;
 168             LINE_CACHE_REC *rec;
 169             LINE_CACHE_SUB_REC *sub;
 170             GSList *lines;
 171             unsigned char cmd;
 172             const unsigned char *ptr, *next_ptr, *last_space_ptr;
 173             int xpos, pos, indent_pos, last_space, last_color, color, linecount;
 174             int char_width;
 175      
line <= 4095176             g_return_val_if_fail(line->text != NULL, NULL);     /* Null Pointer Dereference */
       Exit XS_Irssi__TextUI__TextBufferView_get_line_cache / textbuffer_view_get_line_cache / view_update_line_cache
     Exit XS_Irssi__TextUI__TextBufferView_get_line_cache / textbuffer_view_get_line_cache
Preconditions
&$unknown_3112652 = 899
&$unknown_3112653 = 0
Postconditions
_g_boolean_var_' = 0
_g_boolean_var_' = 1
$unknown_3112630' = $unknown_3112630 - 4
cache' = 0
cv' = $param_2
items' != 2
line' = 0
line' = 0
line' = 0
my_perl' = $param_1
view' = &$unknown_3112650
view' = &$unknown_3112650
view' = &$unknown_3112650




Change Warning 2355.2366 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: