bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #65588] A buffer overrun in handling of .SHELLFLAGS.


From: Dmitry Goncharov
Subject: [bug #65588] A buffer overrun in handling of .SHELLFLAGS.
Date: Sun, 21 Apr 2024 17:15:54 -0400 (EDT)

Follow-up Comment #2, bug #65588 (group make):

sv65588_part1.diff and sv65588_part2.diff fix the buffer overflow.
Make (with sv65588_part1.diff and sv65588_part2.diff applied) behaves
differently in oneshell mode compared to when .ONESHELL is not specified.
Specifically when .ONESHELL is not specified and shellflags carries an
unterminated quote, make switches to the slow mode to have the shell deal with
the
quote.


$ ls
makefile
$ cat makefile 
.SHELLFLAGS:=hello'
all:;:
$ 
$ 
$ make
:
/bin/sh: 1: Syntax error: Unterminated quoted string
make: *** [makefile:2: all] Error 2


When .ONESHELL is specified, make (with sv65588_part1.diff and
sv65588_part2.diff applied) proceeds to run the job regardless of the
unterminated quote.


$ cat makefile
.ONESHELL:
.SHELLFLAGS:=hello'
all:;:
$ make
:
/bin/sh: 0: cannot open hello': No such file
make: *** [makefile:3: all] Error 2



sv65588_part3.diff modifies construct_command_argv_internal to have oneshell
mode handle an unterminated quote the same as when .ONESHELL is not
specified.

Tested on linux, sunos and aix, all 64 and 32 bits.



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65588>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]