Fixed a problem where filenames of a certain length would cause a crash.
authorDavid Griffith <dave@661.org>
Sat, 25 Aug 2012 04:36:24 +0000 (21:36 -0700)
committerDavid Griffith <dave@661.org>
Sat, 25 Aug 2012 04:36:24 +0000 (21:36 -0700)
src/curses/ux_init.c

index 2b6afb969cf824cccb0fee6fd951eb6ebd10e97f..89a4d5c5e578a4e66642a21e3eef9b5ded123cbd 100644 (file)
@@ -299,7 +299,7 @@ void os_process_arguments (int argc, char *argv[])
 
     /* Create nice default file names */
 
-    u_setup.blorb_name = malloc(strlen(f_setup.story_name) * sizeof(char) + 5);
+    u_setup.blorb_name = malloc(FILENAME_MAX);
     strncpy(u_setup.blorb_name, f_setup.story_name,
        strlen(f_setup.story_name) +1);
     strncat(u_setup.blorb_name, EXT_BLORB, strlen(EXT_BLORB));