Opened 10 years ago

Closed 10 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.

Change History (2)

comment:1 by graham.hudspith@…, 10 years ago

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

comment:2 by Ion Gaztañaga, 10 years ago

Resolution: fixed
Status: newclosed

(In [82434]) Fixes #7484

Note: See TracTickets for help on using tickets.