Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 7414.28515
Similar Warnings: 7414.28516
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) {
 710                 linecount = view_get_linecount(view, *lines);   /* Null Pointer Dereference (ID: 7414.28516) */
 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  
   ...
 726                         break;
 727                 }
 728  
 729                 if ((*lines)->next == NULL)
 730                         break;
 731  
 732                 *lines = (*lines)->next;
 733         }
 734  
 735         /* scroll up */ 
 736         while (scrollcount < 0 && (*lines)->prev != NULL) {
 737                 *lines = (*lines)->prev;
true738                 linecount = view_get_linecount(view, *lines);     /* Null Pointer Dereference */
 739  
 740                 realcount -= linecount;
 741                 scrollcount += linecount;
 742                 if (scrollcount > 0) {
Preconditions
lines != view + 40
(*lines)->prev != 0
((char*)&$unknown_1985747)[8] = 0
Postconditions
scroll_visible' = 0
scrollcount' <= -1




Change Warning 7414.28515 : Null Pointer Dereference

Because they are very similar, this warning shares annotations with warning 7414.28516.

Priority:
State:
Finding:
Owner:
Note: