Sketcher: Ensure copy of temp string is kept
Coverity issue 545249. A temporary string is constructed, and its address stored via c_str(). That pointer is then used after the string is destroyed. The fix is to store the std::string.
This commit is contained in:
committed by
Benjamin Nauck
parent
1c3f643420
commit
a95e355c9a
@@ -95,8 +95,8 @@ private:
|
||||
}
|
||||
|
||||
if (file.hasExtension("skf")) {
|
||||
auto filename = file.fileNamePure().c_str();
|
||||
auto* pcFeature = pcDoc->addObject<Sketcher::SketchObjectSF>(filename);
|
||||
auto filename = file.fileNamePure();
|
||||
auto* pcFeature = pcDoc->addObject<Sketcher::SketchObjectSF>(filename.c_str());
|
||||
pcFeature->SketchFlatFile.setValue(EncodedName.c_str());
|
||||
|
||||
pcDoc->recompute();
|
||||
|
||||
Reference in New Issue
Block a user