From 50a2a479c158c85575b2e93513e5d1c33193db1f Mon Sep 17 00:00:00 2001 From: cold-brewed <47337035+cold-brewed@users.noreply.github.com> Date: Sat, 23 Mar 2024 16:15:35 -0400 Subject: [PATCH] Revert earlier change to zip_load to fix an image load crash --- src/disk/zip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/disk/zip.c b/src/disk/zip.c index d4b644865..7045b1e41 100644 --- a/src/disk/zip.c +++ b/src/disk/zip.c @@ -531,7 +531,7 @@ zip_load(zip_t *dev, char *fn) if (fseek(dev->drv->fp, dev->drv->base, SEEK_SET) == -1) fatal("zip_load(): Error seeking to the beginning of the file\n"); - strncpy(dev->drv->image_path, fn, strlen(dev->drv->image_path) + 1); + strncpy(dev->drv->image_path, fn, sizeof(dev->drv->image_path) - 1); return 1; }