Quellcode durchsuchen

small: fix segfault for poll options

green vor 1 Jahr
Ursprung
Commit
207d9e0f01
1 geänderte Dateien mit 2 neuen und 1 gelöschten Zeilen
  1. 2 1
      html.c

+ 2 - 1
html.c

@@ -780,7 +780,8 @@ xs_html *html_note(snac *user, const char *summary,
     if (poll) {
     if (poll) {
         const xs_number *max_options = xs_dict_get(srv_config, "max_poll_options");
         const xs_number *max_options = xs_dict_get(srv_config, "max_poll_options");
         xs *poll_limit_str = xs_dup(L("Poll options (one per line, up to 8):"));
         xs *poll_limit_str = xs_dup(L("Poll options (one per line, up to 8):"));
-        poll_limit_str = xs_replace_i(poll_limit_str, "8", xs_number_str(max_options));
+        if (max_options != NULL)
+            poll_limit_str = xs_replace_i(poll_limit_str, "8", xs_number_str(max_options));
 
 
         xs_html_add(form,
         xs_html_add(form,
             xs_html_tag("p", NULL),
             xs_html_tag("p", NULL),