Permalink
Browse files

Merge pull request #144 from tsdgeos/v1

Make sure context.file is not null before calling strlen.
  • Loading branch information...
2 parents 1116cb9 + 154c0d1 commit 2ee7e5ff737026a4dfa89801fac63561279040f4 @niemeyer niemeyer committed Feb 9, 2015
Showing with 2 additions and 1 deletion.
  1. +2 −1 cpp/capi.cpp
View
@@ -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);
}

0 comments on commit 2ee7e5f

Please sign in to comment.