Text  |   XML   |   Visible Warnings:

irssi-0.8.14 : irssi-0.8.14 analysis 2 : Null Pointer Dereference  at statusbar.c:522

Categories: LANG.MEM.NPD CWE:476
Warning ID: 7445.28552
Similar Warnings: 7445.28553
Procedure: statusbar_create
Trace: view
Modified: Thu Nov 26 11:21:08 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/statusbar.c
   Enter statusbar_create
 458 STATUSBAR_REC *statusbar_create(STATUSBAR_GROUP_REC *group,
 459                                 STATUSBAR_CONFIG_REC *config,
 460                                 MAIN_WINDOW_REC *parent_window) 
 461 {
 462         STATUSBAR_REC *bar;
 463         THEME_REC *theme;
 464         GSList *tmp;
 465         char *name, *value;
 466  
 467         g_return_val_if_fail(group != NULL, NULL);
 468         g_return_val_if_fail(config != NULL, NULL);
 469         g_return_val_if_fail(config->type != STATUSBAR_TYPE_WINDOW ||
 470                              parent_window != NULL, NULL);
 471  
 472         bar = g_new0(STATUSBAR_REC, 1);
 473         group->bars = g_slist_append(group->bars, bar);
 474  
 475         bar->group = group;
 476  
 477         bar->config = config;
 478         bar->parent_window = parent_window;
 479  
 480         irssi_set_dirty();
 481         bar->dirty = TRUE;
 482         bar->dirty_xpos = 0;
 483  
 484         signal_remove("terminal resized", (SIGNAL_FUNC) sig_terminal_resized);   /* Dangerous Function Cast (ID: 4250.28108) */
 485         signal_remove("mainwindow resized", (SIGNAL_FUNC) sig_mainwindow_resized);   /* Dangerous Function Cast (ID: 4248.28107) */
 486         signal_remove("mainwindow moved", (SIGNAL_FUNC) sig_mainwindow_resized);   /* Dangerous Function Cast (ID: 4246.28106) */
 487  
 488         if (config->type == STATUSBAR_TYPE_ROOT) {
 489                 /* top/bottom of the screen */ 
 490                 mainwindows_reserve_lines(config->placement == STATUSBAR_TOP,
 491                                           config->placement == STATUSBAR_BOTTOM);
 492                 theme = current_theme;
 493         } else {
 494                 /* top/bottom of the window */ 
 495                 parent_window->statusbars = 
 496                         g_slist_append(parent_window->statusbars, bar);
 497                 mainwindow_set_statusbar_lines(parent_window,
 498                                                config->placement == STATUSBAR_TOP,
 499                                                config->placement == STATUSBAR_BOTTOM);
 500                 theme = parent_window != NULL && parent_window->active != NULL &&   /* Null Test After Dereference (ID: 7444.28551) */
 501                         parent_window->active->theme != NULL ? 
 502                         parent_window->active->theme : current_theme;
 503         }
 504  
 505         signal_add("terminal resized", (SIGNAL_FUNC) sig_terminal_resized);   /* Dangerous Function Cast (ID: 4243.28105) */
 506         signal_add("mainwindow resized", (SIGNAL_FUNC) sig_mainwindow_resized);   /* Dangerous Function Cast (ID: 4241.28104) */
 507         signal_add("mainwindow moved", (SIGNAL_FUNC) sig_mainwindow_resized);   /* Dangerous Function Cast (ID: 4239.28103) */
 508  
 509         /* get background color from sb_background abstract */ 
 510         name = g_strdup_printf("{sb_%s_bg}", config->name);
 511         value = theme_format_expand(theme, name);
 512         g_free(name);
 513  
 514         if (*value == '\0') {   /* Null Pointer Dereference (ID: 7445.28553) */
 515                 /* try with the statusbar group name */ 
 516                 g_free(value);
 517  
 518                 name = g_strdup_printf("{sb_%s_bg}", group->name);
true519                 value = theme_format_expand(theme, name);
 520                 g_free(name);
 521  
value <= 4095522                 if (*value == '\0') {     /* Null Pointer Dereference */
Preconditions
config->type = 2
config->placement != 1
config->placement != 2
parent_window->active->theme != 0
$unknown_2195123 <= 125
$unknown_2195123 >= 123
strlen(&$unknown_2195123) != 0
$unknown_2195124 = 0
strlen(&$unknown_2195124) = 0
Postconditions
_g_boolean_var_' = 1
_g_boolean_var_' = 1
_g_boolean_var_' = 1
bar' = &$unknown_2195121
dirty' = 1
name' = 0
theme' = parent_window->active->theme
value' = 0




Change Warning 7445.28552 : Null Pointer Dereference

Because they are very similar, this warning shares annotations with warning 7445.28553.

Priority:
State:
Finding:
Owner:
Note: