pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
swi-prolog-lite: Avoid overlapping `src' and `dst' in strcpy(3)
Module Name: pkgsrc-wip
Committed By: Leonardo Taccari <leot%NetBSD.org@localhost>
Pushed By: leot
Date: Mon Sep 24 22:57:02 2018 +0200
Changeset: 8154b95a40a31b064c09285b3926b0b9ad03dee3
Modified Files:
swi-prolog-lite/distinfo
Added Files:
swi-prolog-lite/patches/patch-src_os_pl-files.c
Log Message:
swi-prolog-lite: Avoid overlapping `src' and `dst' in strcpy(3)
This was actually triggered by building swi-prolog-packages, now
swi-prolog-packages correctly builds!
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=8154b95a40a31b064c09285b3926b0b9ad03dee3
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
swi-prolog-lite/distinfo | 1 +
swi-prolog-lite/patches/patch-src_os_pl-files.c | 40 +++++++++++++++++++++++++
2 files changed, 41 insertions(+)
diffs:
diff --git a/swi-prolog-lite/distinfo b/swi-prolog-lite/distinfo
index 9df2e2d55a..a416d3c0e3 100644
--- a/swi-prolog-lite/distinfo
+++ b/swi-prolog-lite/distinfo
@@ -9,6 +9,7 @@ SHA1 (patch-packages_Dialect.defs.in) = f75ceac51bae428a81ba2001d39d8408ccb099f9
SHA1 (patch-packages_clib_sha1_brg_endian.h) = e7bc21953cedafce67e0070b9ec326446bf474fa
SHA1 (patch-src_Makefile.in) = d71ce5f67d5c78579d860ab4889f78d380f6a1b8
SHA1 (patch-src_libtai_Makefile.in) = f36eaf85e5e9109184528888de99fa0929229652
+SHA1 (patch-src_os_pl-files.c) = 222a9a4682808fc62e410b01f38e31c4dcc62f53
SHA1 (patch-src_os_windows_Makefile.in) = b7e8c2035e626ab9c29d14818da0e1ac0c6a23fc
SHA1 (patch-src_pl-funcs.h) = fd821e245ca49a42e595096d05a21ee20d25c41c
SHA1 (patch-src_pl-rsort.c) = 233430c9ead3e1361f40ae541d0527408a141d6e
diff --git a/swi-prolog-lite/patches/patch-src_os_pl-files.c b/swi-prolog-lite/patches/patch-src_os_pl-files.c
new file mode 100644
index 0000000000..5416ae1876
--- /dev/null
+++ b/swi-prolog-lite/patches/patch-src_os_pl-files.c
@@ -0,0 +1,40 @@
+$NetBSD$
+
+Avoid overlapping `src' and `dst' in strcpy(3).
+
+This is reproducible via:
+
+ % ln -s `which swi-prolog` swipl-l
+ % ./swipl-l
+
+...and was also triggered similarly as part of building swi-prolog-packages.
+
+--- src/os/pl-files.c.orig 2018-01-12 12:04:38.000000000 +0000
++++ src/os/pl-files.c
+@@ -273,6 +273,7 @@ ReadLink(const char *f, char *buf)
+ static char *
+ DeRefLink1(const char *f, char *lbuf)
+ { char buf[MAXPATHLEN];
++ char tmpbuf[MAXPATHLEN];
+ char *l;
+
+ if ( (l=ReadLink(f, buf)) )
+@@ -282,13 +283,14 @@ DeRefLink1(const char *f, char *lbuf)
+ } else
+ { char *q;
+
+- strcpy(lbuf, f);
+- q = &lbuf[strlen(lbuf)];
+- while(q>lbuf && q[-1] != '/')
++ strcpy(tmpbuf, f);
++ q = &tmpbuf[strlen(tmpbuf)];
++ while(q>tmpbuf && q[-1] != '/')
+ q--;
+ strcpy(q, l);
+
+- canonicaliseFileName(lbuf);
++ canonicaliseFileName(tmpbuf);
++ strcpy(lbuf, tmpbuf);
+
+ return lbuf;
+ }
Home |
Main Index |
Thread Index |
Old Index