Changeset: ec76161adec3 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ec76161adec3
Modified Files:
        buildtools/Mx/disclaimer.c
Branch: default
Log Message:

Prevent buffer underflow and close string.  Also recognize alternative record 
separator on Windows.


diffs (19 lines):

diff -r 135c86c30203 -r ec76161adec3 buildtools/Mx/disclaimer.c
--- a/buildtools/Mx/disclaimer.c        Tue Jun 01 13:24:26 2010 +0200
+++ b/buildtools/Mx/disclaimer.c        Tue Jun 01 14:23:49 2010 +0200
@@ -47,8 +47,14 @@
                buf[0] = '\0';
                strncat(buf, inputdir, 8096 - 1);
                len = strlen(buf);
-               if (len < 8095 && buf[len - 1] != DIR_SEP)
+               if (len > 0 && len < 8095 && buf[len - 1] != DIR_SEP
+#ifdef WIN32
+                   && buf[len - 1] != '/'
+#endif
+                       ) {
                        buf[len++] = DIR_SEP;
+                       buf[len] = 0;
+               }
                /* search backwards, such that we can find the license.txt
                 * file in the root of each module */
                strncat(buf, filename, 8095 - len);
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to