]> git.proxmox.com Git - qemu.git/blobdiff - tests/cris/check_stat4.c
tests/cris: Fix some errors and potential crashes
[qemu.git] / tests / cris / check_stat4.c
index e1955cab3471d83e7fd1913b3f0c3c73c1337f81..04f21fe7c4f53e042b9cf230d576495aaf009180 100644 (file)
@@ -15,7 +15,7 @@ int main (int argc, char *argv[])
   char path[1024] = "/";
   struct stat buf;
 
-  strcat (path, argv[0]);
+  strncat(path, argv[0], sizeof(path) - 2);
   if (lstat (".", &buf) != 0
       || !S_ISDIR (buf.st_mode))
     abort ();