Explorar o código

Fix logic error resulting in NULL dereference. Not a possible case currently.

Spotted by:	scan-build
Bryan Drewery %!s(int64=11) %!d(string=hai) anos
pai
achega
26128ff61e
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      src/mod/irc.mod/irc.cc

+ 5 - 1
src/mod/irc.mod/irc.cc

@@ -921,7 +921,11 @@ getin_request(char *botnick, char *code, char *par)
 static void
 static void
 request_op(struct chanset_t *chan)
 request_op(struct chanset_t *chan)
 {
 {
-  if (!chan || (chan && (channel_pending(chan) || !shouldjoin(chan) || !channel_active(chan) || me_op(chan)))) {
+  if (!chan) {
+    return;
+  }
+
+  if (channel_pending(chan) || !shouldjoin(chan) || !channel_active(chan) || me_op(chan)) {
     chan->channel.do_opreq = 0;
     chan->channel.do_opreq = 0;
     return;
     return;
   }
   }