Ticket #7484 (closed Bugs: fixed)

Opened 3 years ago

Last modified 3 years ago

shared_memory_object does not initialise m_mode in default ctor

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


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.


Change History

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

  • Summary changed from shared_memory_object does initialise m_mode in default ctor to shared_memory_object does not initialise m_mode in default ctor

comment:2 Changed 3 years ago by igaztanaga

  • Status changed from new to closed
  • Resolution set to fixed

(In [82434]) Fixes #7484


Add a comment

Modify Ticket

Change Properties
<Author field>
as closed
The resolution will be deleted. Next status will be 'reopened'

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

Note: See TracTickets for help on using tickets.