summaryrefslogtreecommitdiffstats
path: root/misc/pinfo/gcc10-stringop.diff
diff options
context:
space:
mode:
author Matteo Bernardini2021-04-10 17:02:43 +0200
committer Matteo Bernardini2021-04-10 17:02:43 +0200
commit97e000b8ce16626a160e2196627fb0c884dbcfbf (patch)
treec8bf51d3d2d2b60a4ca906996a8c17ed9cb3ffb9 /misc/pinfo/gcc10-stringop.diff
parentcf65c072371dbcb73b7ea6d75de27bb6b96899f7 (diff)
downloadslackbuilds-current-20210410.1.tar.gz
20210410.1 global branch merge.current-20210410.1
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Diffstat (limited to 'misc/pinfo/gcc10-stringop.diff')
-rw-r--r--misc/pinfo/gcc10-stringop.diff28
1 files changed, 28 insertions, 0 deletions
diff --git a/misc/pinfo/gcc10-stringop.diff b/misc/pinfo/gcc10-stringop.diff
new file mode 100644
index 0000000000..a57fa91d08
--- /dev/null
+++ b/misc/pinfo/gcc10-stringop.diff
@@ -0,0 +1,28 @@
+diff --git a/src/utils.c b/src/utils.c
+index cb2fe76..2e4139c 100644
+--- a/src/utils.c
++++ b/src/utils.c
+@@ -848,10 +848,9 @@ char *
+ make_tempfile()
+ {
+ char *filename;
+- size_t len;
+
+ /* TODO: fix hardcoded /tmp */
+- char tmpfile_template[] = "/tmp/pinfo.XXXXXX";
++ char tmpfile_template[32] = "/tmp/pinfo.XXXXXX";
+
+ /* create a tmpfile */
+ int fd = mkstemp(tmpfile_template);
+@@ -864,9 +863,8 @@ make_tempfile()
+ }
+
+ /* allocate a new string and copy the filename there */
+- len = strlen(tmpfile_template)+1;
+- filename = xmalloc(len+1); /* guarenteerd to be set to \0's */
+- strncpy(filename, tmpfile_template, len);
++ filename = xmalloc(33); /* guarenteerd to be set to \0's */
++ strncpy(filename, tmpfile_template, 32);
+
+ /* close the file */
+ close(fd);