[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #58497] inconsistent newline removal in $(file <)
From: |
Ken |
Subject: |
[bug #58497] inconsistent newline removal in $(file <) |
Date: |
Thu, 4 Jun 2020 10:06:38 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36 |
URL:
<https://savannah.gnu.org/bugs/?58497>
Summary: inconsistent newline removal in $(file <)
Project: make
Submitted by: kennyt
Submitted on: Thu 04 Jun 2020 10:06:36 AM EDT
Severity: 3 - Normal
Item Group: Bug
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Component Version: 4.3
Operating System: Any
Fixed Release: None
Triage Status: None
_______________________________________________________
Details:
Within $(file <), the output variable's string buffer can get reallocated,
potentially being moved to a smaller address than the one it started with.
At the end of this function, the code looks for a final newline to strip, but
only if at least one character has been read.
In order to determine whether a character was read, the code tests whether the
pointer into the buffer has increased, and this is not the case if the buffer
was reallocated to a smaller address.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Thu 04 Jun 2020 10:06:36 AM EDT Name:
0001-src-function.c-func_file-fix-inconsistent-newline-re.patch Size: 2KiB
By: kennyt
<http://savannah.gnu.org/bugs/download.php?file_id=49212>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?58497>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [bug #58497] inconsistent newline removal in $(file <),
Ken <=