Text  |   XML   |   Visible Warnings:

irssi-0.8.14 : irssi-0.8.14 analysis 2 : Null Pointer Dereference  at textbuffer-view.c:710

Categories: LANG.MEM.NPD CWE:476
Warning ID: 7414.28516
Similar Warnings: 7414.28515
Procedure: view_scroll
Trace: view
Modified: Thu Nov 26 11:19:50 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-text/textbuffer-view.c
   Enter view_scroll
 695 static int view_scroll(TEXT_BUFFER_VIEW_REC *view, LINE_REC **lines,
 696                        int *subline, int scrollcount, int draw_nonclean) 
 697 {
 698         int linecount, realcount, scroll_visible;
 699  
 700         if (*lines == NULL)
 701                 return 0;
 702  
 703         /* scroll down */ 
 704         scroll_visible = lines == &view->startline;
 705  
 706         realcount = -*subline;
 707         scrollcount += *subline;
 708         *subline = 0;
 709         while (scrollcount > 0) {
true710                 linecount = view_get_linecount(view, *lines);     /* Null Pointer Dereference */
 711  
 712                 if ((scroll_visible && *lines == view->bottom_startline) &&
 713                     (scrollcount >= view->bottom_subline)) {
 714                         *subline = view->bottom_subline;
 715                         realcount += view->bottom_subline;
 716                         scrollcount = 0;
 717                         break;
 718                 }
 719  
 720                 realcount += linecount;
 721                 scrollcount -= linecount;
 722                 if (scrollcount < 0) {
 723                         realcount += scrollcount;
 724                         *subline = linecount+scrollcount;
 725                         scrollcount = 0;
 726                         break;
 727                 }
 728  
 729                 if ((*lines)->next == NULL)
 730                         break;
 731  
 732                 *lines = (*lines)->next;
Preconditions
lines != view + 40
&$unknown_1985966 >= 1
Postconditions
((char*)&$unknown_1985967)[8]' = 0
scroll_visible' = 0
scrollcount' = &$unknown_1985966




Change Warning 7414.28516 : Null Pointer Dereference

Because they are very similar, this warning shares annotations with warning 7414.28515.
CodeSonar has selected warning 7414.28515 to represent this group of similar warnings. In order to edit this group, you must edit warning 7414.28515.