re PR ada/79309 (incorrectly bounded calls to strncat in adaint.c)
authorEric Botcazou <ebotcazou@gcc.gnu.org>
Wed, 1 Feb 2017 21:36:09 +0000 (21:36 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Wed, 1 Feb 2017 21:36:09 +0000 (21:36 +0000)
PR ada/79309
* adaint.c (__gnat_killprocesstree): Use strlen instead of sizeof.

From-SVN: r245107

gcc/ada/adaint.c

index e5fea3e..bff875a 100644 (file)
@@ -3401,7 +3401,7 @@ void __gnat_killprocesstree (int pid, int sig_num)
 
           /* read /proc/<PID>/stat */
 
-          if (strlen (d->d_name) >= sizeof (statfile) - sizeof ("/proc//stat"))
+          if (strlen (d->d_name) >= sizeof (statfile) - strlen ("/proc//stat"))
             continue;
           strcpy (statfile, "/proc/");
           strcat (statfile, d->d_name);