Skip to content

Commit

Permalink
Merge pull request #144 from tsdgeos/v1
Browse files Browse the repository at this point in the history
Make sure context.file is not null before calling strlen.
  • Loading branch information
niemeyer committed Feb 9, 2015
2 parents 1116cb9 + 154c0d1 commit 2ee7e5f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cpp/capi.cpp
Expand Up @@ -847,7 +847,8 @@ QQmlListProperty_ *newListProperty(GoAddr *addr, intptr_t reflectIndex, intptr_t
void internalLogHandler(QtMsgType severity, const QMessageLogContext &context, const QString &text)
{
QByteArray textba = text.toUtf8();
LogMessage message = {severity, textba.constData(), textba.size(), context.file, (int)strlen(context.file), context.line};
const int fileLength = context.file ? strlen(context.file) : 0;
LogMessage message = {severity, textba.constData(), textba.size(), context.file, fileLength, context.line};
hookLogHandler(&message);
}

Expand Down

0 comments on commit 2ee7e5f

Please sign in to comment.