From 60ab85958c4a6ae86ef8d8675a0fbe348602357b Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 1 Feb 2017 21:36:09 +0000 Subject: [PATCH] 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 --- gcc/ada/adaint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.30.2