bugmake - Bugs: bug #27148, Use of strcpy on overlapping...


bug #27148: Use of strcpy on overlapping memory areas

Submitter:  None
Submitted:  Fri 31 Jul 2009 12:13:56 PM UTC
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  3.81 Operating System:  Any
Fixed Release:  3.82 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup

Sat 01 Aug 2009 11:28:24 PM UTC, comment #1: 

Fixed.  Thanks for the patch!

Paul D. Smith <psmith>
Group administrator
Fri 31 Jul 2009 12:13:56 PM UTC, original submission:  

This bug report in Red Hat bugzilla has a nice reproducer and valgrind citation:

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.



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #18503:  make-3.81-strcpy-overlap.patch added by None (595B - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-07-28 psmith Fixed Release4.0 3.82
    2009-08-01 psmith StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.0
    2009-07-31 None Attached File- Added make-3.81-strcpy-overlap.patch, #18503

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code