From 04d1dc5111b134e8618dd306149dc7a768838c77 Mon Sep 17 00:00:00 2001 From: Bryce Harrington Date: Sat, 29 Aug 2015 16:30:03 -0700 Subject: Ensure strncpy'd strings are null terminated (bzr r14332) --- src/io/streamtest.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/io/streamtest.cpp') diff --git a/src/io/streamtest.cpp b/src/io/streamtest.cpp index 2030e6a85..ec59ac4a6 100644 --- a/src/io/streamtest.cpp +++ b/src/io/streamtest.cpp @@ -202,6 +202,7 @@ void path_init(char *path, char *name) exit(1); } strncpy(ptr+1,name,strlen(name)+1); + path[PATH_MAX-1] = '\0'; printf("'%s'\n",path); } -- cgit v1.2.3