Potential null-pointer dereference fix

This commit is contained in:
Jack Andersen 2015-09-09 13:43:08 -10:00
parent 3120e1bc94
commit 968233b495
2 changed files with 5 additions and 1 deletions

View File

@ -205,7 +205,11 @@ public:
int width = HECL::ConsoleWidth(); int width = HECL::ConsoleWidth();
int half = width / 2 - 2; int half = width / 2 - 2;
if (!message)
message = _S("");
size_t messageLen = HECL::StrLen(message); size_t messageLen = HECL::StrLen(message);
if (!submessage)
submessage = _S("");
size_t submessageLen = HECL::StrLen(submessage); size_t submessageLen = HECL::StrLen(submessage);
if (half - messageLen < submessageLen-2) if (half - messageLen < submessageLen-2)
submessageLen = 0; submessageLen = 0;

2
hecl/extern/Athena vendored

@ -1 +1 @@
Subproject commit 89fa92308f6d2c8019a0e6202930aa721cba63bc Subproject commit 4ffce2dbc3a48ba1fc8142456630d584ab32ec57