Просмотр исходного кода

* Cmd_chhandle was not checking if the old handle existed

svn: 1351
Bryan Drewery 21 лет назад
Родитель
Сommit
9ada502522
2 измененных файлов с 6 добавлено и 0 удалено
  1. 1 0
      doc/UPDATES
  2. 5 0
      src/cmds.c

+ 1 - 0
doc/UPDATES

@@ -42,6 +42,7 @@ This is a summary of ChangeLog basically.
 * closed-private and ban-time were mixed up in the saving/loading process.
 * closed-private and ban-time were mixed up in the saving/loading process.
 * cmd_swhois now shows matching username
 * cmd_swhois now shows matching username
 * cmd_botcmd * is now limited to +n only
 * cmd_botcmd * is now limited to +n only
+* cmd_chhandle did not check if the old handle existed!
 
 
 1.1.9
 1.1.9
 
 

+ 5 - 0
src/cmds.c

@@ -1341,6 +1341,11 @@ static void cmd_chhandle(int idx, char *par)
     dprintf(idx, "Somebody is already using %s.\n", newhand);
     dprintf(idx, "Somebody is already using %s.\n", newhand);
   else {
   else {
     struct userrec *u2 = get_user_by_handle(userlist, hand);
     struct userrec *u2 = get_user_by_handle(userlist, hand);
+
+    if (!u2) {
+      dprintf(idx, "No such handle!\n");
+      return;
+    }
     int atr = dcc[idx].user ? dcc[idx].user->flags : 0, atr2 = u2 ? u2->flags : 0;
     int atr = dcc[idx].user ? dcc[idx].user->flags : 0, atr2 = u2 ? u2->flags : 0;
 
 
     if (!(atr & USER_MASTER) && !u2->bot)
     if (!(atr & USER_MASTER) && !u2->bot)