[gimp/gimp-2-10] Issue #1678 - CWE-120 - Don't use strcpy()
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] Issue #1678 - CWE-120 - Don't use strcpy()
- Date: Tue, 19 Jun 2018 13:40:33 +0000 (UTC)
commit 9c1f6bfc16d47558444eec0000f0b629334d7c4d
Author: Michael Natterer <mitch gimp org>
Date: Tue Jun 19 15:37:54 2018 +0200
Issue #1678 - CWE-120 - Don't use strcpy()
Use strncpy() instead.
(cherry picked from commit a58fe8963af4a984b0e0d7fb860c17fa165aa6c5)
plug-ins/common/file-ps.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/common/file-ps.c b/plug-ins/common/file-ps.c
index e39972e71e..a96ccd07c9 100644
--- a/plug-ins/common/file-ps.c
+++ b/plug-ins/common/file-ps.c
@@ -880,7 +880,7 @@ run (const gchar *name,
plvals.resolution = size / 4;
plvals.width = size;
plvals.height = size;
- strcpy (plvals.pages, "1");
+ strncpy (plvals.pages, "1", sizeof (plvals.pages) - 1);
check_load_vals ();
image_ID = load_image (param[0].data.d_string, &error);
@@ -1310,7 +1310,7 @@ check_load_vals (void)
plvals.height = 2;
plvals.use_bbox = (plvals.use_bbox != 0);
if (plvals.pages[0] == '\0')
- strcpy (plvals.pages, "1-99");
+ strncpy (plvals.pages, "1-99", sizeof (plvals.pages) - 1);
if ((plvals.pnm_type < 4) || (plvals.pnm_type > 7))
plvals.pnm_type = 6;
if ( (plvals.textalpha != 1) && (plvals.textalpha != 2)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]