ASan: QtMessageContext doesn’t copy file names
Use the ‘file name copying’ version of log(), to avoid an ASan use- after-free. Note this requires SG change 908496d43dd7c3a7ca1de42b0e0c21aa0498c7df to work correctly.
This commit is contained in:
parent
c9d1d58146
commit
f802e09c57
1 changed files with 3 additions and 1 deletions
|
@ -223,7 +223,9 @@ static void simgearMessageOutput(QtMsgType type, const QMessageLogContext &conte
|
|||
|
||||
static const char* nullFile = "";
|
||||
const char* file = context.file ? context.file : nullFile;
|
||||
sglog().log(SG_GUI, mappedPriority, file, context.line, msg.toStdString());
|
||||
const auto s = msg.toStdString();
|
||||
// important we copy the file name here, since QMessageLogContext doesn't
|
||||
sglog().logCopyingFilename(SG_GUI, mappedPriority, file, context.line, s);
|
||||
if (type == QtFatalMsg) {
|
||||
abort();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue