From: Eric Botcazou Date: Wed, 1 Feb 2017 21:36:09 +0000 (+0000) Subject: re PR ada/79309 (incorrectly bounded calls to strncat in adaint.c) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=60ab85958c4a6ae86ef8d8675a0fbe348602357b;p=gcc.git re PR ada/79309 (incorrectly bounded calls to strncat in adaint.c) PR ada/79309 * adaint.c (__gnat_killprocesstree): Use strlen instead of sizeof. From-SVN: r245107 --- diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index e5fea3eefe0..bff875a6822 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -3401,7 +3401,7 @@ void __gnat_killprocesstree (int pid, int sig_num) /* read /proc//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);