summaryrefslogtreecommitdiff
path: root/src/cairo-cff-subset.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cairo-cff-subset.c')
-rw-r--r--src/cairo-cff-subset.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cairo-cff-subset.c b/src/cairo-cff-subset.c
index da49e8e1e..ca1437e46 100644
--- a/src/cairo-cff-subset.c
+++ b/src/cairo-cff-subset.c
@@ -51,6 +51,7 @@
#include "cairo-scaled-font-subsets-private.h"
#include "cairo-truetype-subset-private.h"
+#include <stdio.h>
#include <string.h>
#include <locale.h>
@@ -331,7 +332,12 @@ decode_real (unsigned char *p, double *real)
buf = buffer2 + (q - buffer);
strncpy (buf, decimal_point, decimal_point_len);
buf += decimal_point_len;
- strcpy (buf, q + 1);
+
+ //(2017.04.17) Since securitY issue, replace strcpy to strncpy.
+ //strcpy (buf, q + 1);
+ strncpy (buf, q + 1, (buffer + sizeof(buffer)/sizeof(buffer[0])) - (q + 1));
+ //same as strncpy (buf, q + 1, 100 - (q + 1));
+
buf = buffer2;
}