fixed possible crash in cmd_NeonServ.mod/cmd_neonserv_mode.c
authorpk910 <philipp@zoelle1.de>
Fri, 22 Feb 2013 08:03:31 +0000 (09:03 +0100)
committerpk910 <philipp@zoelle1.de>
Fri, 22 Feb 2013 08:03:31 +0000 (09:03 +0100)
src/modules/NeonServ.mod/cmd_neonserv_mode.c

index 41e0455..a1a9125 100644 (file)
@@ -206,7 +206,7 @@ static void neonserv_cmd_mode_async1(struct ClientSocket *client, struct ClientS
                 default:
                     modetype = getModeType(modelock, modeStr[i]);
                     if(modetype == 0) {
-                        reply(textclient, user, "NS_MODE_INVALID", modeStr[i]);
+                        reply(textclient, user, "NS_MODE_INVALID", modeStr);
                         return;
                     }
                     if(isModeAffected(modelock, modeStr[i]) && add == !isModeSet(modelock, modeStr[i]) && uaccess < db_enfmodes) {
@@ -220,7 +220,7 @@ static void neonserv_cmd_mode_async1(struct ClientSocket *client, struct ClientS
                     }
                     if(add && (modetype & CHANNEL_MODE_TYPE) != CHANNEL_MODE_TYPE_D) {
                         if(arg == argc) {
-                            reply(textclient, user, "NS_MODE_INVALID", modeStr[i]);
+                            reply(textclient, user, "NS_MODE_INVALID", modeStr);
                             return;
                         }
                         carg = argv[arg++];
@@ -250,7 +250,7 @@ static void neonserv_cmd_mode_async1(struct ClientSocket *client, struct ClientS
                         }
                     } else if(!add && (modetype & CHANNEL_MODE_TYPE) == CHANNEL_MODE_TYPE_B) {
                         if(arg == argc && !(modetype & CHANNEL_MODE_KEY)) {
-                            reply(textclient, user, "NS_MODE_INVALID", modeStr[i]);
+                            reply(textclient, user, "NS_MODE_INVALID", modeStr);
                             return;
                         }
                         carg = (arg == argc ? NULL : argv[arg++]);
@@ -278,7 +278,7 @@ static void neonserv_cmd_mode_async1(struct ClientSocket *client, struct ClientS
                                 modeBufferSimpleMode(modeBuf, add, modeStr[i]);
                             }
                         } else {
-                            reply(textclient, user, "NS_MODE_INVALID", modeStr[i]);
+                            reply(textclient, user, "NS_MODE_INVALID", modeStr);
                             return;
                         }
                     }