Skip to content

Commit c288002

Browse files
committed
Fixed an issue with strlen checking null ptr
Program called "Moom" (http://manytricks.com/moom/) which uses OS X's accesibility API could cause a crash with calling the log handler with a null file in context.
1 parent 807b51d commit c288002

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cpp/capi.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,8 @@ QQmlListProperty_ *newListProperty(GoAddr *addr, intptr_t reflectIndex, intptr_t
855855

856856
void internalLogHandler(QtMsgType severity, const QMessageLogContext &context, const QString &text)
857857
{
858+
if (context.file == NULL) return;
859+
858860
QByteArray textba = text.toUtf8();
859861
LogMessage message = {severity, textba.constData(), textba.size(), context.file, (int)strlen(context.file), context.line};
860862
hookLogHandler(&message);

0 commit comments

Comments
 (0)