Text  |   XML   |   Visible Warnings:

Irssi : Irssi analysis 1 : Null Pointer Dereference  at completion.c:603

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2224.2230
Procedure: sig_complete_word
Trace: View
Modified: Wed Sep 2 11:53:18 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 sig_complete_word
 555 static void sig_complete_word(GList **list, WINDOW_REC *window,
 556                               const char *word, const char *linestart,
 557                               int *want_space) 
 558 {
 559         const char *newword, *cmdchars;
 560         char *signal, *cmd, *args, *line;
 561  
 562         g_return_if_fail(list != NULL);
 563         g_return_if_fail(word != NULL);
 564         g_return_if_fail(linestart != NULL);
 565  
 566         /* check against "completion words" list */ 
 567         newword = completion_find(word, FALSE);
 568         if (newword != NULL) {
 569                 *list = g_list_append(*list, g_strdup(newword));
 570  
 571                 signal_stop();
 572                 return;
 573         }
 574  
 575         if (*linestart != '\0' && (*word == '/' || *word == '~')) {
 576                 /* quite likely filename completion */ 
 577                 *list = g_list_concat(*list, filename_complete(word, NULL));
 578                 if (*list != NULL) {
 579                         *want_space = FALSE;
 580                         signal_stop();
 581                         return;
 582                 }
 583         }
 584  
 585         /* command completion? */ 
true586         cmdchars = settings_get_str("cmdchars");
 587         if (*word != '\0' && *linestart == '\0' && strchr(cmdchars, *word)) {   /* Null Pointer Dereference (ID: 2225.2231) */
 588                 /* complete /command */ 
 589                 *list = completion_get_commands(word+1, *word);
 590  
 591                 /* complete aliases, too */ 
 592                 *list = g_list_concat(*list,
 593                                       completion_get_aliases(word+1, *word));
 594  
 595                 if (*list != NULL) signal_stop();
 596                 return;
 597         }
 598  
 599         /* check only for /command completions from now on */ 
 600         if (*linestart == '\0')
 601                 return;
 602  
cmdchars <= 4095603         cmdchars = strchr(cmdchars, *linestart);     /* Null Pointer Dereference */
Preconditions
&$unknown_612411 != 0
*$param_3 = 126
strlen($param_3) != 0
*$param_4 != 0
strlen($param_4) != 0
Postconditions
_g_boolean_var_' = 1
_g_boolean_var_' = 1
_g_boolean_var_' = 1
cmdchars' = 0
linestart' = $param_4
list' = $param_1
newword' = 0
want_space' = $param_5
window' = $param_2
word' = $param_3




Change Warning 2224.2230 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: