I2PC / xmippCore

Core functions for Xmipp and sharing with other packages (like Scipion)
GNU General Public License v3.0
4 stars 2 forks source link

Returning dangling references in MetaData::getValue #187

Closed oierlauzi closed 1 year ago

oierlauzi commented 1 year ago

This code is incorrect and dangerous, as it returns a reference to a member of mdValueOut . The object is destroyed before exiting the function, thus, the reference to its member is dangling.

There are two possible solutions to the problem: