URL:
  <http://savannah.gnu.org/bugs/?27148>

                 Summary: Use of strcpy on overlapping memory areas
                 Project: make
            Submitted by: None
            Submitted on: Птн 31 Июл 2009 12:13:56
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 3.81
        Operating System: Any
           Fixed Release: None

    _______________________________________________________

Details:

This bug report in Red Hat bugzilla has a nice reproducer and valgrind
citation:
https://bugzilla.redhat.com/show_bug.cgi?id=514721

The problem is that in job.c:new_job, when copying the rest of the string
after the last $ expansion, the areas may overlap.  I'll attach proposed patch
(formed against today's CVS) that replaces strcpy with memmove+strlen. 
Alternative solution would be to simply replace offending strcpy with while
(*out++ = *in++);.  Hard to say which of these will be more efficient.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Птн 31 Июл 2009 12:13:57  Name: make-3.81-strcpy-overlap.patch 
Size: 595B   By: None

<http://savannah.gnu.org/bugs/download.php?file_id=18503>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27148>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to