From 098403eba68799fe2adef6f806e3447108540f51 Mon Sep 17 00:00:00 2001 From: korei999 <ju7t1xe@gmail.com> Date: Fri, 17 Jan 2025 19:05:25 +0200 Subject: [PATCH] arraylist_add: don't overflow when strcpy to the icon --- file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file.c b/file.c index 3091abb..1f9ebca 100644 --- a/file.c +++ b/file.c @@ -69,7 +69,7 @@ void arraylist_remove(ArrayList *list, long index) void arraylist_add(ArrayList *list, char *name, char *path, char *stats, int type, char *icon, int color, int marked, int force) { file new_file = { name, path, type, stats, color }; - strcpy(new_file.icon, icon); + strncpy(new_file.icon, icon, sizeof(new_file.icon) / sizeof(new_file.icon[0])); if (list->capacity != list->length) { if (marked) {