Text  |   XML   |   Visible Warnings:

Irssi : Irssi analysis 1 : Uninitialized Variable  at completion.c:158

Categories: LANG.MEM.UVAR CWE:457
Warning ID: 2222.2228
Procedure: word_complete
Trace: View
Modified: Wed Sep 2 11:53:16 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-common/core/completion.c
   Enter word_complete
true131 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 */ 
 157                 word = get_word_at(line, *pos, &wordstart);
wordstart is uninitialized158                 startpos = (int) (wordstart-line);     /* Uninitialized Variable */
Preconditions
$param_4 != 0
*$param_3 <= -1
strlen(last_line) = strlen($param_2)
complist != 0
last_line_pos <= -1
last_line_pos = *$param_3
Postconditions
_g_boolean_var_' = 1
_g_boolean_var_' = 1
backward' = $param_5
continue_complete' = 1
erase' = $param_4
line' = $param_2
old_startpos' = startpos
old_wordlen' = wordlen
pos' = $param_3
window' = $param_1
word' = 0




Change Warning 2222.2228 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: