From 730440b07cc02109c2cf03314942ac49f70edea6 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sun, 1 Jan 2023 10:49:05 -0800 Subject: [PATCH] Do not crash on symbol gen for long file names --- src/uxnasm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/uxnasm.c b/src/uxnasm.c index 454eb9d..a3e901a 100644 --- a/src/uxnasm.c +++ b/src/uxnasm.c @@ -451,8 +451,11 @@ review(char *filename) static void writesym(char *filename) { - char symdst[0x40]; - FILE *fp = fopen(scat(scpy(filename, symdst, slen(filename) + 1), ".sym"), "w"); + char symdst[0x60]; + FILE *fp; + if(slen(filename) > 0x60 - 5) + return; + fp = fopen(scat(scpy(filename, symdst, slen(filename) + 1), ".sym"), "w"); int i; if(fp != NULL) { for(i = 0; i < p.llen; i++) {