bug-make
[Top][All Lists]
Advanced

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

[bug #27148] Use of strcpy on overlapping memory areas


From: anonymous
Subject: [bug #27148] Use of strcpy on overlapping memory areas
Date: Fri, 31 Jul 2009 12:13:58 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; ru; rv:1.9.1.1) Gecko/20090717 Fedora/3.5.1-1.fc11 Firefox/3.5.1

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/





reply via email to

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