Use strncpy() instead of strcpy() to avoid buffer overflows.

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

        * plug-ins/common/gqbist.c: Use strncpy() instead of strcpy() to
        avoid buffer overflows.


svn path=/trunk/; revision=22667
This commit is contained in:
Mukund Sivaraman 2007-05-30 16:00:10 +00:00 committed by Mukund Sivaraman
parent 8b3e91c015
commit ddd9121be0
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2007-05-30 Mukund Sivaraman <muks@mukund.org>
* plug-ins/common/gqbist.c: Use strncpy() instead of strcpy() to
avoid buffer overflows.
2007-05-30 Mukund Sivaraman <muks@mukund.org>
* plug-ins/common/gtm.c: Use strncpy() instead of strcpy() to avoid

View File

@ -725,7 +725,7 @@ dialog_load (GtkWidget *widget,
{
gchar *name = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
strcpy (qbist_info.path, name);
strncpy (qbist_info.path, name, PATH_MAX - 1);
load_data (qbist_info.path);
g_free (name);
@ -770,7 +770,7 @@ dialog_save (GtkWidget *widget,
{
gchar *name = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
strcpy (qbist_info.path, name);
strncpy (qbist_info.path, name, PATH_MAX - 1);
save_data (qbist_info.path);
g_free (name);