Text  |   XML   |   Visible Warnings:

irssi-0.8.14 : irssi-0.8.14 analysis 2 : Null Pointer Dereference  at set.c:44

Categories: LANG.MEM.NPD CWE:476
Warning ID: 7332.28425
Procedure: config_node_remove
Trace: view
Modified: Thu Nov 26 11:09:39 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-common/core/themes.c
   Enter module_save
 1103 static void module_save(const char *module, MODULE_THEME_REC *rec,
 1104                         THEME_SAVE_REC *data) 
 1105 {
 1106         CONFIG_NODE *fnode, *node;
 1107         FORMAT_REC *formats;
 1108         int n;
 1109  
 1110         formats = g_hash_table_lookup(default_formats, rec->name);
 1111         if (formats == NULL) return;
 1112  
 1113         fnode = config_node_traverse(data->config, "formats", TRUE);
 1114  
 1115         node = config_node_section(fnode, rec->name, NODE_TYPE_BLOCK);
 1116         for (n = 1; formats[n].def != NULL; n++) {
 1117                 if (rec->formats[n] != NULL) {
 1118                         config_node_set_str(data->config, node, formats[n].tag,
 1119                                             rec->formats[n]);
 1120                 } else if (data->save_all && formats[n].tag != NULL) {
 1121                         config_node_set_str(data->config, node, formats[n].tag,
 1122                                             formats[n].def);
 1123                 }
 1124         }
 1125  
 1126         if (node->value == NULL) {   /* Null Pointer Dereference (ID: 7333.28426) */
 1127                 /* not modified, don't keep the empty section */ 
 1128                 config_node_remove(data->config, fnode, node);
true1129                 if (fnode->value == NULL) {
data->config->mainnode <= 40951130                         config_node_remove(data->config,
true1131                                            data->config->mainnode, fnode);
     /kat0/fletcher/SATE/2010/irssi-0.8.14/src/lib-config/set.c
     Enter module_save / config_node_remove
 35   void config_node_remove(CONFIG_REC *rec, CONFIG_NODE *parent, CONFIG_NODE *node) 
 36   {
 37           g_return_if_fail(node != NULL);
 38    
 39           if (parent == NULL)
rec->mainnode <= 409540                   parent = rec->mainnode;
 41    
 42           rec->modifycounter++;
 43           cache_remove(rec, node);
parent <= 409544           parent->value = g_slist_remove(parent->value, node);     /* Null Pointer Dereference */  /* 2 more... */
     Exit module_save / config_node_remove
Preconditions
node->key != 0
$unknown_574932 <= 3
$unknown_574932 >= 2
((char*)&$unknown_574934)[8] = 0
Postconditions
_g_boolean_var_' = 1
fnode' = &$unknown_574932
formats' = &$unknown_574931
node' = &$unknown_574934
node' = &$unknown_574932
parent' = 0
rec' = data->config




Change Warning 7332.28425 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: