From ca0ee767cb5f93420b456fa47422ae2b3e266b4f Mon Sep 17 00:00:00 2001 From: dankan1890 Date: Mon, 3 Feb 2020 17:59:24 +0100 Subject: [PATCH] Fixed String::humanize_size crash. Close #35872 --- core/ustring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/ustring.cpp b/core/ustring.cpp index 8a1fbfd3836..08418463a0a 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -3324,7 +3324,7 @@ String String::humanize_size(uint64_t p_size) { int prefix_idx = 0; - while (prefix_idx < prefixes.size() && p_size > (_div * 1024)) { + while (prefix_idx < prefixes.size() - 1 && p_size > (_div * 1024)) { _div *= 1024; prefix_idx++; }