Text  |   XML   |   Visible Warnings:

irssi-0.8.14 : irssi-0.8.14 analysis 2 : Null Pointer Dereference  at completion.c:159

Categories: LANG.MEM.NPD CWE:476
Warning ID: 7286.28374
Procedure: word_complete
Trace: view
Modified: Thu Nov 26 11:09:09 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-common/core/completion.c
   Enter word_complete
 131 char *word_complete(WINDOW_REC *window, const char *line, int *pos, int erase, int backward) 
 132 {
 133         static int startpos = 0, wordlen = 0;
 134         int old_startpos, old_wordlen;
 135  
 136         GString *result;
 137         char *word, *wordstart, *linestart, *ret;
 138         int continue_complete, want_space;
 139  
 140         g_return_val_if_fail(line != NULL, NULL);
 141         g_return_val_if_fail(pos != NULL, NULL);
 142  
 143         continue_complete = complist != NULL && *pos == last_line_pos && 
 144                 strcmp(line, last_line) == 0;
 145  
 146         if (erase && !continue_complete)
 147                 return NULL;
 148  
 149         old_startpos = startpos;
 150         old_wordlen = wordlen;
 151  
 152         if (!erase && continue_complete) {
 153                 word = NULL;
 154                 linestart = NULL;
 155         } else {
 156                 /* get the word we want to complete */ 
true157                 word = get_word_at(line, *pos, &wordstart);
 158                 startpos = (int) (wordstart-line);   /* Uninitialized Variable (ID: 7287.28375) */
word <= 4095159                 wordlen = strlen(word);     /* Null Pointer Dereference */
Preconditions
erase != 0
*pos <= -1
*last_line = *line
strlen(last_line) = strlen(line)
complist != 0
last_line_pos <= -1
last_line_pos = *pos
Postconditions
_g_boolean_var_' = 1
_g_boolean_var_' = 1
continue_complete' = 1
old_startpos' = startpos
old_wordlen' = wordlen
word' = 0




Change Warning 7286.28374 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: