bugDDD - Bugs: bug #51281, WhenReadyInfo::WhenReadyInfo() :...

 
 

bug #51281: WhenReadyInfo::WhenReadyInfo() : wrong use of memcpy()

Submitted by:  Zdenek Sojka <zsojka>
Submitted on:  Tue 20 Jun 2017 09:15:26 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: OpenRelease: 3.3.12-rc2

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Wed 21 Jun 2017 09:10:09 AM UTC, comment #2:

cbs.event is written to just on the very next line, so if the intention of the memcpy() is to write cbs.event, it can be removed altogether.

Zdenek Sojka <zsojka>
Wed 21 Jun 2017 07:55:00 AM UTC, comment #1:

The compiler warning is correct but the fix should just require the address-of operator (&) on the first parameter cbs.event.

Ian Kirkham <expl_squirrel>
Tue 20 Jun 2017 09:15:26 PM UTC, original submission:

When compiling DDD with a recent gcc (5.4.0 in my case), the following warning is given:

The warning seems to be valid, since the memcpy() parameters are most likely the same (dst == src), and the size is size_of_pointer.

event is unitialized (its default constructor is used; if applicable)

This patch might trigger the originally intended behavior:

Zdenek Sojka <zsojka>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by expl_squirrel (Posted a comment)
  • -unavailable- added by zsojka (Submitted the item)
  •  

    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):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup1