From 33c62db7afc345722c767368e97566e41bfd7a8a Mon Sep 17 00:00:00 2001 From: qarmin Date: Sat, 24 Aug 2019 13:34:14 +0200 Subject: [PATCH] Add forgotten pointer checking --- core/ustring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/ustring.cpp b/core/ustring.cpp index 21696e2a557..3f5e1982816 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -2150,7 +2150,7 @@ int64_t String::to_int(const CharType *p_str, int p_len) { if (integer > INT32_MAX / 10) { String number(""); str = p_str; - while (str != limit) { + while (*str && str != limit) { number += *(str++); } ERR_FAIL_V_MSG(sign == 1 ? INT32_MAX : INT32_MIN, "Cannot represent " + number + " as integer, provided value is " + (sign == 1 ? "too big." : "too small."));