Text  |   XML   |   Visible Warnings:

irssi-0.8.14 : irssi-0.8.14 analysis 2 : Null Pointer Dereference  at gui-readline.c:425

Categories: LANG.MEM.NPD CWE:476
Warning ID: 22025.28533
Procedure: check_pasting
Trace: view
Modified: Thu Nov 26 11:20:44 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/gui-readline.c
   Enter check_pasting
 381 static int check_pasting(unichar key, int diff) 
 382 {
 383         if (paste_state < 0)
 384                 return FALSE;
 385  
 386         if (paste_state == 0) {
 387                 /* two keys hit together quick. possibly pasting */ 
 388                 if (diff > paste_detect_time)
 389                         return FALSE;
 390  
 391                 g_free(paste_entry);
true392                 paste_entry = gui_entry_get_text(active_entry);
 393                 paste_entry_pos = gui_entry_get_pos(active_entry);
 394  
 395                 paste_state++;
 396                 paste_line_count = 0;
 397                 paste_keycount = 0;
 398                 g_array_set_size(paste_buffer, 0);
 399                 if (prev_key != '\r' && prev_key != '\n') {
 400                         paste_keycount++;
 401                 }
 402         } else if (paste_state > 0 && diff > paste_detect_time &&   /* Redundant Condition (ID: 7430.28532) */
 403                    paste_line_count == 0) {
 404                 /* reset paste state */ 
 405                 paste_state = 0;
 406                 return FALSE;
 407         }
 408  
 409         /* continuing quick hits */ 
 410         if (paste_prompt) {
 411                 if (key == 11 || key == 3)
 412                         paste_flush(key == 11);
 413                 return TRUE;
 414         }
 415  
 416         g_array_append_val(paste_buffer, key);
 417         if ((key == '\r' || key == '\n') &&
 418             (prev_key != '\r' && prev_key != '\n')) {
 419                 if (paste_state == 1) {
 420                         if (paste_keycount < paste_detect_keycount) {
 421                                 /* not enough keypresses to determine if this is 
 422                                    pasting or not. don't reset paste_keycount, but 
 423                                    send this line as non-pasted */ 
 424                                 g_array_set_size(paste_buffer, 0);
paste_entry <= 4095425                                 *paste_entry = '\0';     /* Null Pointer Dereference */
Preconditions
&$unknown_2088205 = 13
active_entry = 0
paste_detect_keycount >= 2
paste_detect_time >= diff
paste_prompt = 0
paste_state = 0
prev_key != 10
prev_key != 13
Postconditions
key' = &$unknown_2088205
paste_entry' = 0
paste_entry_pos' = 0
paste_keycount' = 1
paste_line_count' = 0
paste_state' = paste_state + 1




Change Warning 22025.28533 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: