Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 7420.28522
Procedure: text_chunk_line_free
Trace: view
Modified: Thu Nov 26 11:20:01 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.c
   Enter text_chunk_line_free
 112 static void text_chunk_line_free(TEXT_BUFFER_REC *buffer, LINE_REC *line) 
 113 {
 114         TEXT_CHUNK_REC *chunk;
 115         const unsigned char *text;
 116         unsigned char cmd, *tmp = NULL;
 117  
 118         for (text = line->text;; text++) {
 119                 if (*text != '\0')
 120                         continue;
 121  
 122                 text++;
 123                 cmd = *text;
 124                 if (cmd == LINE_CMD_CONTINUE || cmd == LINE_CMD_EOL) {
 125                         if (cmd == LINE_CMD_CONTINUE)
 126                                 memcpy(&tmp, text+1, sizeof(char *));
 127  
 128                         /* free the previous block */ 
true129                         chunk = text_chunk_find(buffer, text);
chunk <= 4095130                         if (--chunk->refcount == 0) {     /* Null Pointer Dereference */
 131                                 if (buffer->cur_text == chunk)
 132                                         chunk->pos = 0;
 133                                 else 
 134                                         text_chunk_destroy(buffer, chunk);
 135                         }
 136  
 137                         if (cmd == LINE_CMD_EOL)
 138                                 break;
 139  
 140                         text = tmp-1;
Preconditions
$unknown_1998843 = 0
strlen(&$unknown_1998843) = 0
((char*)&$unknown_1998843)[1] = 129
Postconditions
chunk' = 0
cmd' = ((char*)&$unknown_1998843)[1]
text' = &$unknown_1998843 + 1




Change Warning 7420.28522 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: