Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2353.2364
Similar Warnings: 2353.2363
Procedure: view_scroll
Trace: View
Modified: Wed Sep 2 12:19:39 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/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
$param_2 != $param_1 + 72
&$unknown_3096766 >= 1
Postconditions
((char*)&$unknown_3096768)[16]' = 0
draw_nonclean' = $param_5
lines' = $param_2
scroll_visible' = 0
scrollcount' = &$unknown_3096766
subline' = $param_3
view' = $param_1




Change Warning 2353.2364 : Null Pointer Dereference

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