Re: Segmentation Fault on Exported Resursively Expanded Variable

2024-01-16 Thread Henrik Carlqvist
On Tue, 16 Jan 2024 20:53:19 +0200 Eli Zaretskii wrote: > From: Henrik Carlqvist > > On Tue, 16 Jan 2024 06:59:30 + > > MIAOW Miao 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

Re: Segmentation Fault on Exported Resursively Expanded Variable

2024-01-16 Thread Dmitry Goncharov
On Mon, Jan 15, 2024 at 9:02 AM MIAOW Miao wrote: > Here is a Makefile that can reproduce the segmentation fault: > > THIS_LONG_VARIABLE_NAME_PREDUCE_THE_ERROR= $(shell echo hello) > export THIS_LONG_VARIABLE_NAME_PREDUCE_THE_ERROR > > all: ; echo "abc" Thank you for your report. A added a fix h

[bug #65172] Fix a buffer overrun on a variable with a long name.

2024-01-16 Thread Dmitry Goncharov
Follow-up Comment #1, bug#65172 (group make): A user reported a buffer overflow on a variable with a long name. Here is a fix. [SV 65172] Fix a buffer overrun on a variable with a long name. * src/expand.c (recursively_expand_for_file): Fix a buffer overrun. * tests/scripts/functio

[bug #65172] Fix a buffer overrun on a variable with a long name.

2024-01-16 Thread Dmitry Goncharov
URL: Summary: Fix a buffer overrun on a variable with a long name. Group: make Submitter: dgoncharov Submitted: Tue 16 Jan 2024 10:43:18 PM UTC Severity: 3 - Normal

Re: Segmentation Fault on Exported Resursively Expanded Variable

2024-01-16 Thread Eli Zaretskii
> Date: Tue, 16 Jan 2024 19:21:04 +0100 > From: Henrik Carlqvist > Cc: psm...@gnu.org, bug-make@gnu.org > > On Tue, 16 Jan 2024 06:59:30 + > MIAOW Miao wrote: > > if ((*ep)[nl] == '=' && strncmp (*ep, v->name, nl) == 0) > > Looking at that line, the rather obvious fix would be to change it

Re: Segmentation Fault on Exported Resursively Expanded Variable

2024-01-16 Thread Henrik Carlqvist
On Tue, 16 Jan 2024 06:59:30 + MIAOW Miao 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 posit

Re: Re: Segmentation Fault on Exported Resursively Expanded Variable

2024-01-16 Thread Paul Smith
On Tue, 2024-01-16 at 06:59 +, MIAOW Miao wrote: > (gdb) bt > #0  recursively_expand_for_file (v=v@entry=0xad5740, > file=file@entry=0x0) at src/expand.c:119 > ... > #20 0x0041acec in main (argc=, argv= out>, envp=) at src/main.c:2918 This is not as helpful because you've elided the en