Specify maximum field width in sscanf() to avoid buffer overflows.

2007-05-31  Mukund Sivaraman  <muks@mukund.org>

        * plug-ins/gfig/gfig.c: Specify maximum field width in sscanf() to
        avoid buffer overflows.


svn path=/trunk/; revision=22682
This commit is contained in:
Mukund Sivaraman 2007-05-31 10:30:46 +00:00 committed by Mukund Sivaraman
parent 97ded8c030
commit 1bf9e5623a
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2007-05-31 Mukund Sivaraman <muks@mukund.org>
* plug-ins/gfig/gfig.c: Specify maximum field width in sscanf() to
avoid buffer overflows.
2007-05-31 Mukund Sivaraman <muks@mukund.org>
* plug-ins/common/spheredesigner.c: Don't write to an uninitialized

View File

@ -603,11 +603,11 @@ load_options (GFigObj *gfig,
{
/* Get option name */
#ifdef DEBUG
printf ("num = %d\n", sscanf (load_buf, "%s %s", str_buf, opt_buf));
printf ("num = %d\n", sscanf (load_buf, "%255s %255s", str_buf, opt_buf));
printf ("option %s val %s\n", str_buf, opt_buf);
#else
sscanf (load_buf, "%s %s", str_buf, opt_buf);
sscanf (load_buf, "%255s %255s", str_buf, opt_buf);
#endif /* DEBUG */
if (!strcmp (str_buf, "GridSpacing:"))