From ba7acdac476b22fdb5c08326f9ed93d2ff37f78b Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 27 Jun 2016 12:59:49 +0200 Subject: [PATCH] Added assert to track stb_textedit.h issue (#715) --- imgui.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/imgui.cpp b/imgui.cpp index 19fb9bdf..e411fe09 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -7406,6 +7406,7 @@ static void STB_TEXTEDIT_DELETECHARS(STB_TEXTEDIT_STRING* obj, int pos, int n) static bool STB_TEXTEDIT_INSERTCHARS(STB_TEXTEDIT_STRING* obj, int pos, const ImWchar* new_text, int new_text_len) { const int text_len = obj->CurLenW; + IM_ASSERT(pos <= text_len); if (new_text_len + text_len + 1 > obj->Text.Size) return false;