After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 334114 - Use of uninitialised variable reported by the Coverity checker
Use of uninitialised variable reported by the Coverity checker
Status: RESOLVED FIXED
Product: planner
Classification: Other
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: planner-maint
planner-maint
Depends on:
Blocks:
 
 
Reported: 2006-03-10 11:04 UTC by Kjartan Maraas
Modified: 2009-09-15 08:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
First attempt at fixing this. (5.95 KB, patch)
2006-07-18 00:32 UTC, Lincoln Phipps
none Details | Review

Description Kjartan Maraas 2006-03-10 11:04:07 UTC
431  	static gboolean
432  	recalc_bounds (PlannerUsageRow *row)
433  	{
434  		PlannerUsageRowPriv *priv;
435  		GnomeCanvasItem      *item;
436  		gint                  width;

Event var_decl: Declared variable "x_debut_real" without initializer
Also see events: [uninit_use]

437  		gdouble               x_debut, x_fin, x_debut_real;
438  		gdouble               old_x, old_x_start, old_width;
439  		gboolean              changed;
440  		
441  		item = GNOME_CANVAS_ITEM (row);
442  	
443  		priv = row->priv;
444  	
445  		old_x = priv->x;
446  		old_x_start = priv->x_start;
447  		old_width = priv->width;
448  	
449  		usage_row_ensure_layout (row);
450  	

At conditional (1): "(priv)->layout != 0" taking true path

451  		if (priv->layout != NULL) {
452  			pango_layout_get_pixel_size (priv->layout,
453  						     &width,
454  						     NULL);
455  		}
456  		else {
457  			width = 0;
458  		}
459  			

At conditional (2): "width > 0" taking true path

460  		if (width > 0) {
461  			width += TEXT_PADDING;
462  		}
463  	
464  		priv->text_width = width;
465  	    

At conditional (3): "(priv)->assignment != 0" taking false path

466  		if (priv->assignment) {
467  			get_assignment_bounds (priv->assignment, priv->scale,
468  					       &x_debut, &x_fin, &x_debut_real);
469  		}

At conditional (4): "(priv)->resource != 0" taking false path

470  		else if (priv->resource) {
471  			get_resource_bounds (priv->resource, priv->scale, &x_debut,
472  					     &x_fin, &x_debut_real);
473  		}
474  		
475  		priv->x = x_debut;
476  		priv->width = x_fin - x_debut;

Event uninit_use: Using uninitialized value "x_debut_real"
Also see events: [var_decl]

477  		priv->x_start = x_debut_real
Comment 1 Kjartan Maraas 2006-03-10 11:06:44 UTC
It reports the same thing for:

gdouble x_debut; and gdouble x_fin; in the same function.
Comment 2 Lincoln Phipps 2006-07-18 00:32:31 UTC
Created attachment 69081 [details] [review]
First attempt at fixing this.

Same patch for 334113, 334114, 334116 , 334117, 334121
Comment 3 Kjartan Maraas 2009-09-15 08:46:45 UTC
Looks like this patch was applied. Closing.