Text  |   XML   |   Visible Warnings:

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

Categories: LANG.MEM.NPD CWE:476
Warning ID: 7300.28389
Procedure: theme_load
Trace: view
Modified: Thu Nov 26 11:09:17 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_load
 821 THEME_REC *theme_load(const char *setname) 
 822 {
 823         THEME_REC *theme, *oldtheme;
 824         struct stat statbuf;
 825         char *fname, *name, *p;
 826  
 827         name = g_strdup(setname);
 828         p = strrchr(name, '.');
 829         if (p != NULL && strcmp(p, ".theme") == 0) {
 830                 /* remove the trailing .theme */ 
 831                 *p = '\0';
 832         }
 833  
 834         theme = theme_find(name);
 835  
 836         /* check home dir */ 
 837         fname = g_strdup_printf("%s/%s.theme", get_irssi_dir(), name);
 838         if (stat(fname, &statbuf) != 0) {
 839                 /* check global config dir */ 
 840                 g_free(fname);
 841                 fname = g_strdup_printf(THEMESDIR"/%s.theme", name);
 842                 if (stat(fname, &statbuf) != 0) {
 843                         /* theme not found */ 
 844                         g_free(fname);
 845                         g_free(name);
 846                         return theme; /* use the one in memory if possible */ 
 847                 }
 848         }
 849  
 850         if (theme != NULL && theme->last_modify == statbuf.st_mtime) {
 851                 /* theme not modified, use the one already in memory */ 
 852                 g_free(fname);
 853                 g_free(name);
 854                 return theme;
 855         }
 856  
 857         oldtheme = theme;
true858         theme = theme_create(fname, name);
theme <= 4095859         theme->last_modify = statbuf.st_mtime;     /* Null Pointer Dereference */
Preconditions
&$unknown_432629 != 0
$unknown_432627 <= 46
Postconditions
fname' = 0
name' = &$unknown_432626
oldtheme' = themes->data
p' = &$unknown_432627
statbuf.st_mtim.tv_sec' != ((char*)themes->data)[12]
theme' = 0




Change Warning 7300.28389 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: