]> Zhao Yanbai Git Server - minix.git/commitdiff
procfs: use safe string copy
authorThomas Veerman <thomas@minix3.org>
Thu, 26 Jul 2012 15:17:25 +0000 (15:17 +0000)
committerThomas Veerman <thomas@minix3.org>
Mon, 30 Jul 2012 09:44:58 +0000 (09:44 +0000)
servers/procfs/tree.c

index 35c0a6f5aa3e074ab6891eb58554e4f96eb1f7e8..26848e9621c2e7ecd1f77d22010822a5d7d99805 100644 (file)
@@ -282,7 +282,7 @@ static void construct_pid_dirs(void)
                        pid = mproc[i - NR_TASKS].mp_pid;
 
                /* Add the entry for the process slot. */
-               sprintf(name, "%d", pid);
+               snprintf(name, PNAME_MAX + 1, "%d", pid);
 
                make_stat(&stat, i, NO_INDEX);