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/


Reply via email to