Changeset: e0e48f6a4f67 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e0e48f6a4f67
Modified Files:
        gdk/gdk_storage.c
Branch: Jul2012
Log Message:

Make coverity happy by null terminating a string.


diffs (14 lines):

diff --git a/gdk/gdk_storage.c b/gdk/gdk_storage.c
--- a/gdk/gdk_storage.c
+++ b/gdk/gdk_storage.c
@@ -76,7 +76,9 @@ GDKcreatedir(const char *dir)
        char *r;
        int ret = FALSE;
 
-       strcpy(path, dir);
+       assert(strlen(dir) < sizeof(path));
+       strncpy(path, dir, sizeof(path)-1);
+       path[sizeof(path)-1] = 0;
        r = strrchr(path, DIR_SEP);
        IODEBUG THRprintf(GDKstdout, "#GDKcreatedir(%s)\n", path);
 
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to