]> granicus.if.org Git - nethack/commitdiff
Increase buffer size for saving menucolors
authorPasi Kallinen <paxed@alt.org>
Fri, 5 Aug 2022 15:19:02 +0000 (18:19 +0300)
committerPasi Kallinen <paxed@alt.org>
Fri, 5 Aug 2022 15:19:07 +0000 (18:19 +0300)
The '"regex"=color&attr' is max BUFSZ, so prefixing with MENUCOLOR=
and adding a newline overflowed the temp buffer when saving the
menucolors.

src/options.c

index 05a2ec02487a4f5aad8590b749ae9389b5c91994..36eb69f5f29da682bded5f8757722a2934e14992 100644 (file)
@@ -8788,7 +8788,7 @@ all_options_menucolors(strbuf_t *sbuf)
 {
     int i = 0, ncolors = count_menucolors();
     struct menucoloring *tmp = g.menu_colorings;
-    char buf[BUFSZ];
+    char buf[BUFSZ*2]; /* see also: add_menu_coloring() */
     struct menucoloring **arr;
 
     if (!ncolors)