Modify

Opened 5 years ago

Closed 5 years ago

#7484 closed Bugs (fixed)

shared_memory_object does not initialise m_mode in default ctor

Reported by: Graham Hudspith <graham.hudspith@…> Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: interprocess
Version: Boost 1.51.0 Severity: Problem
Keywords: Cc:

Description

The default ctor for shared_memory_object does not initialise the m_mode member.

I can't find an enum/#define for the "zero" value of mode_t, so I guess a simple:

inline shared_memory_object::shared_memory_object()
   :  m_handle(file_handle_t(ipcdetail::invalid_file())),
      m_mode(0) // <--- this is the new line
{}

would do the job.

Reported to us when we run a static analysis program on our code which uses the boost interprocess library.

This is against the 1.51.0 release of boost, but I've checked your svn trunk and it is still there.

Attachments (0)

Change History (2)

comment:1 Changed 5 years ago by graham.hudspith@…

Summary: shared_memory_object does initialise m_mode in default ctorshared_memory_object does not initialise m_mode in default ctor

comment:2 Changed 5 years ago by Ion Gaztañaga

Resolution: fixed
Status: newclosed

(In [82434]) Fixes #7484

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ion Gaztañaga.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.