Avoid crashing in chanserv_is_dnr() when handle == NULL.
[srvx.git] / src / chanserv.c
index 8bc2a6100de4be82242795aeb47400c3fe1aacf8..8be8a276c5b534fb6de81f6b943d3957a0848676 100644 (file)
@@ -1610,7 +1610,7 @@ chanserv_is_dnr(const char *chan_name, struct handle_info *handle)
     struct dnrList list;
     struct do_not_register *dnr;
 
-    list = chanserv_find_dnrs(chan_name, handle->handle, 1);
+    list = chanserv_find_dnrs(chan_name, handle ? handle->handle : NULL, 1);
     dnr = list.used ? list.list[0] : NULL;
     free(list.list);
     return dnr;
@@ -7785,8 +7785,8 @@ init_chanserv(const char *nick)
     DEFINE_CHANNEL_OPTION(ctcpreaction);
     DEFINE_CHANNEL_OPTION(inviteme);
     DEFINE_CHANNEL_OPTION(unreviewed);
-    modcmd_register(chanserv_module, "set unreviewed on", NULL, 0, 0, NULL);
-    modcmd_register(chanserv_module, "set unreviewed off", NULL, 0, 0, NULL);
+    modcmd_register(chanserv_module, "set unreviewed on", NULL, 0, 0, "flags", "+helping", NULL);
+    modcmd_register(chanserv_module, "set unreviewed off", NULL, 0, 0, "flags", "+oper", NULL);
     if(off_channel > 1)
         DEFINE_CHANNEL_OPTION(offchannel);
     modcmd_register(chanserv_module, "set defaults", chan_opt_defaults, 1, 0, "access", "owner", NULL);