Skip to content

Commit

Permalink
Fixed|String|libcore: Use of uninitialized value
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent 01fdc6e commit 01b8a97
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion doomsday/libs/core/src/data/string.cpp
Expand Up @@ -1171,7 +1171,11 @@ Char mb_iterator::operator*() const

Char mb_iterator::decode(const char **end) const
{
if (*cur == 0) return {};
if (*cur == 0)
{
if (end) *end = cur;
return {};
}

uint32_t ch = 0;
int rc = decodeBytes_MultibyteChar(cur, strnlen(cur, 8), &ch);
Expand Down Expand Up @@ -1202,6 +1206,7 @@ mb_iterator &mb_iterator::operator++()
{
++cur;
}
DE_ASSERT(cur >= start && cur <= start + strlen(start));
return *this;
}

Expand Down

0 comments on commit 01b8a97

Please sign in to comment.