From debf9864fccd9aadf6af59316165c5dd5aab4b4a Mon Sep 17 00:00:00 2001 From: syaoo <47080438+syaoo@users.noreply.github.com> Date: Wed, 23 Apr 2025 18:08:52 +0800 Subject: [PATCH 1/2] fix check event_data size error when event_data start with 0x0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use `event_inf->event_size[index]` instead of `_webui_strlen(event_inf->event_data[index])`, to avoid this error. --- src/webui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webui.c b/src/webui.c index 55d99bfeb..e9328572b 100644 --- a/src/webui.c +++ b/src/webui.c @@ -1975,7 +1975,7 @@ const char* webui_get_string_at(webui_event_t* e, size_t index) { return NULL; if (event_inf->event_data[index] != NULL) { - size_t len = _webui_strlen(event_inf->event_data[index]); + size_t len = _event_inf->event_size[index]; if (len > 0 && len <= WEBUI_MAX_BUF) return (const char*)event_inf->event_data[index]; } From 8d2f47700c5d32bb766ce4b3962fffd0ce779eac Mon Sep 17 00:00:00 2001 From: Showns <116365846+AlbertShown@users.noreply.github.com> Date: Wed, 23 Apr 2025 10:27:07 -0400 Subject: [PATCH 2/2] Change `_event_inf` to `event_inf` --- src/webui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webui.c b/src/webui.c index e9328572b..01c23faf2 100644 --- a/src/webui.c +++ b/src/webui.c @@ -1975,7 +1975,7 @@ const char* webui_get_string_at(webui_event_t* e, size_t index) { return NULL; if (event_inf->event_data[index] != NULL) { - size_t len = _event_inf->event_size[index]; + size_t len = event_inf->event_size[index]; if (len > 0 && len <= WEBUI_MAX_BUF) return (const char*)event_inf->event_data[index]; }