unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Problem report #108: base/src/emacs/src/font.c (font_unparse_fcname); UNINIT
@ 2008-12-02 22:16 Dan Nicolaescu
  2008-12-02 22:47 ` Andreas Schwab
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Nicolaescu @ 2008-12-02 22:16 UTC (permalink / raw)
  To: emacs-devel

CID: 108
Checker: UNINIT (help)
File: base/src/emacs/src/font.c
Function: font_unparse_fcname
Description: Using uninitialized value "dpi" as argument to function "sprintf"


Event var_decl: Declared variable "dpi" without initializer
Also see events: [uninit_arg]

1604 	  int dpi;
1605 	  int i, len = 1;
1606 	  char *p;
1607 	  Lisp_Object styles[3];
1608 	  char *style_names[3] = { "weight", "slant", "width" };
1609 	  char work[256];
1610 	
1611 	  family = AREF (font, FONT_FAMILY_INDEX);

At conditional (1): "family != Qnil" taking true path

1612 	  if (! NILP (family))
1613 	    {

At conditional (2): "family & 7 == 1" taking true path

1614 	      if (SYMBOLP (family))
1615 		{
1616 		  family = SYMBOL_NAME (family);

At conditional (3): "((0), (family & -8))->size_byte < 0" taking true path

1617 		  len += SBYTES (family);
1618 		}
1619 	      else
1620 		family = Qnil;
1621 	    }
1622 	
1623 	  val = AREF (font, FONT_SIZE_INDEX);

At conditional (4): "val & 7 == 0" taking true path

1624 	  if (INTEGERP (val))
1625 	    {

At conditional (5): "val >> 3 != 0" taking true path

1626 	      if (XINT (val) != 0)
1627 		pixel_size = XINT (val);
1628 	      point_size = -1;
1629 	      len += 21;		/* for ":pixelsize=NUM" */
1630 	    }
1631 	  else if (FLOATP (val))
1632 	    {
1633 	      pixel_size = -1;
1634 	      point_size = (int) XFLOAT_DATA (val);
1635 	      len += 11;		/* for "-NUM" */
1636 	    }
1637 	
1638 	  foundry = AREF (font, FONT_FOUNDRY_INDEX);

At conditional (6): "foundry != Qnil" taking true path

1639 	  if (! NILP (foundry))
1640 	    {

At conditional (7): "foundry & 7 == 1" taking true path

1641 	      if (SYMBOLP (foundry))
1642 		{
1643 		  foundry = SYMBOL_NAME (foundry);

At conditional (8): "((0), (foundry & -8))->size_byte < 0" taking true path

1644 		  len += 9 + SBYTES (foundry); /* ":foundry=NAME" */
1645 		}
1646 	      else
1647 		foundry = Qnil;
1648 	    }
1649 	

At conditional (9): "i < 3" taking true path
At conditional (11): "i < 3" taking true path
At conditional (13): "i < 3" taking true path
At conditional (15): "i < 3" taking false path

1650 	  for (i = 0; i < 3; i++)
1651 	    {
1652 	      styles[i] = font_style_symbolic (font, FONT_WEIGHT_INDEX + i, 0);

At conditional (10): "styles[i] != Qnil" taking true path
At conditional (12): "styles[i] != Qnil" taking true path
At conditional (14): "styles[i] != Qnil" taking true path

1653 	      if (! NILP (styles[i]))
1654 		len += sprintf (work, ":%s=%s", style_names[i],
1655 				SDATA (SYMBOL_NAME (styles[i])));
1656 	    }
1657 	

At conditional (16): "((0), (font & -8))->contents[9] & 7 == 0" taking true path

1658 	  if (INTEGERP (AREF (font, FONT_DPI_INDEX)))

Event uninit_arg: Using uninitialized value "dpi" as argument to function "sprintf"
Also see events: [var_decl]

1659 	    len += sprintf (work, ":dpi=%d", dpi);
1660 	  if (INTEGERP (AREF (font, FONT_SPACING_INDEX)))
1661 	    len += strlen (":spacing=100");
1662 	  if (INTEGERP (AREF (font, FONT_AVGWIDTH_INDEX)))
1663 	    len += strlen (":scalable=false"); /* or ":scalable=true" */




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Problem report #108: base/src/emacs/src/font.c (font_unparse_fcname); UNINIT
  2008-12-02 22:16 Problem report #108: base/src/emacs/src/font.c (font_unparse_fcname); UNINIT Dan Nicolaescu
@ 2008-12-02 22:47 ` Andreas Schwab
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schwab @ 2008-12-02 22:47 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: emacs-devel

Dan Nicolaescu <dann@ics.uci.edu> writes:

> CID: 108
> Checker: UNINIT (help)
> File: base/src/emacs/src/font.c
> Function: font_unparse_fcname
> Description: Using uninitialized value "dpi" as argument to function "sprintf"

Fixed.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-12-02 22:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-02 22:16 Problem report #108: base/src/emacs/src/font.c (font_unparse_fcname); UNINIT Dan Nicolaescu
2008-12-02 22:47 ` Andreas Schwab

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).