Text  |   XML   |   Visible Warnings:

Irssi : Irssi analysis 1 : Null Pointer Dereference  at textbuffer.c:130

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2359.2370
Procedure: text_chunk_line_free
Trace: View
Modified: Wed Sep 2 12:19:51 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-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_3119356 = 0
strlen(&$unknown_3119356) = 0
((char*)&$unknown_3119356)[1] = 129
Postconditions
buffer' = $param_1
chunk' = 0
cmd' = ((char*)&$unknown_3119356)[1]
line' = $param_2
text' = &$unknown_3119356 + 1




Change Warning 2359.2370 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: