Text  |   XML   |   Visible Warnings:

irssi-0.8.14 : irssi-0.8.14 analysis 2 : Null Pointer Dereference  at themes.c:1039

Categories: LANG.MEM.NPD CWE:476
Warning ID: 7331.28424
Procedure: theme_show
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 theme_show
 1012 static void theme_show(THEME_SEARCH_REC *rec, const char *key, const char *value, int reset) 
 1013 {
 1014         MODULE_THEME_REC *theme;
 1015         FORMAT_REC *formats;
 1016         const char *text, *last_title;
 1017         int n, first;
 1018  
 1019         formats = g_hash_table_lookup(default_formats, rec->name);
 1020         theme = g_hash_table_lookup(current_theme->modules, rec->name);
 1021  
 1022         last_title = NULL; first = TRUE;
 1023         for (n = 1; formats[n].def != NULL; n++) {
 1024                 text = theme != NULL && theme->formats[n] != NULL ? 
 1025                         theme->formats[n] : formats[n].def;
 1026  
 1027                 if (formats[n].tag == NULL)
 1028                         last_title = text;
 1029                 else if ((value != NULL && key != NULL && g_strcasecmp(formats[n].tag, key) == 0) ||
 1030                          (value == NULL && (key == NULL || stristr(formats[n].tag, key) != NULL))) {
 1031                         if (first) {
 1032                                 printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_FORMAT_TITLE, rec->short_name, formats[0].def);
 1033                                 first = FALSE;
 1034                         }
 1035                         if (last_title != NULL)
 1036                                 printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_FORMAT_SUBTITLE, last_title);
 1037                         if (reset || value != NULL) {
true1038                                 theme = theme_module_create(current_theme, rec->name);
theme <= 40951039                                 g_free_not_null(theme->formats[n]);     /* Null Pointer Dereference */
 1040                                 g_free_not_null(theme->expanded_formats[n]);
 1041  
 1042                                 text = reset ? formats[n].def : value;
 1043                                 theme->formats[n] = reset ? NULL : g_strdup(value);
 1044                                 theme->expanded_formats[n] = theme_format_expand(current_theme, text);
 1045                         }
 1046                         printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_FORMAT_ITEM, formats[n].tag, text);
 1047                         last_title = NULL;
Preconditions
value = 0
reset != 0
&$unknown_571498 != 0
&$unknown_571500 != 0
strlen(key) > 0
windows >= 0
Postconditions
current_theme->modules' = &$unknown_571501
first' = 0
formats' = &$unknown_571494
last_title' = &$unknown_571500
signal_user_data' = 0
theme' = 0




Change Warning 7331.28424 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: