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

 
 

bug #27148: Use of strcpy on overlapping memory areas

Submitted by:  None
Submitted on:  Fri 31 Jul 2009 12:13:56 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: FixedPrivacy: Public
Assigned to: Paul D. Smith <psmith>Open/Closed: Closed
Component Version: 3.81Operating System: Any
Fixed Release: 3.82Triage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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

Fixed. Thanks for the patch!

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
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:
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.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

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
  • -unavailable- added by psmith (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 28 Jul 2010 06:15:03 AM UTCpsmithFixed Release4.0=>3.82
    Sat 01 Aug 2009 11:28:24 PM UTCpsmithStatusNone=>Fixed
      Assigned toNone=>psmith
      Open/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.0
    Fri 31 Jul 2009 12:13:57 PM UTCNoneAttached File-=>Added make-3.81-strcpy-overlap.patch, #18503

    Back to the top


    Powered by Savane 3.1-cleanup1