[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Segmentation Fault on Exported Resursively Expanded Variable
From: |
Eli Zaretskii |
Subject: |
Re: Segmentation Fault on Exported Resursively Expanded Variable |
Date: |
Tue, 16 Jan 2024 20:53:19 +0200 |
> Date: Tue, 16 Jan 2024 19:21:04 +0100
> From: Henrik Carlqvist <hc981@poolhem.se>
> Cc: psmith@gnu.org, bug-make@gnu.org
>
> On Tue, 16 Jan 2024 06:59:30 +0000
> MIAOW Miao <guoyr_2013@hotmail.com> wrote:
> > if ((*ep)[nl] == '=' && strncmp (*ep, v->name, nl) == 0)
>
> Looking at that line, the rather obvious fix would be to change it to:
>
> if (strncmp (*ep, v->name, nl) == 0 && (*ep)[nl] == '=')
>
> That way, *ep can be no shorter than having \0 at position nl and accessing
> that position should not cause any segfault.
But it's less efficient when the (*ep)[nl] == '=' test fails.
Re: Segmentation Fault on Exported Resursively Expanded Variable, Dmitry Goncharov, 2024/01/15
Re: Segmentation Fault on Exported Resursively Expanded Variable, Dmitry Goncharov, 2024/01/16