From 82cdab831f6cf12eee741b668a5f06c2690ea8b7 Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Mon, 20 Nov 2023 03:38:21 +0000 Subject: [PATCH] Evil portal fix zero terminated ap name --- .../external/evil_portal/helpers/evil_portal_storage.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/applications/external/evil_portal/helpers/evil_portal_storage.c b/applications/external/evil_portal/helpers/evil_portal_storage.c index a58c63ed4..33bef3eab 100644 --- a/applications/external/evil_portal/helpers/evil_portal_storage.c +++ b/applications/external/evil_portal/helpers/evil_portal_storage.c @@ -83,7 +83,7 @@ void evil_portal_read_ap_name(void* context) { if(storage_common_stat(storage, EVIL_PORTAL_AP_SAVE_PATH, &fi) == FSE_OK) { File* ap_name = storage_file_alloc(storage); if(storage_file_open(ap_name, EVIL_PORTAL_AP_SAVE_PATH, FSAM_READ, FSOM_OPEN_EXISTING)) { - app->ap_name = malloc((size_t)fi.size); + app->ap_name = malloc((size_t)fi.size + 1); uint8_t* buf_ptr = app->ap_name; size_t read = 0; while(read < fi.size) { @@ -93,6 +93,8 @@ void evil_portal_read_ap_name(void* context) { read += now_read; buf_ptr += now_read; } + *buf_ptr = '\0'; + buf_ptr++; free(buf_ptr); } storage_file_close(ap_name);