]> jfr.im git - irc/evilnet/x3.git/commitdiff
giveownership crash fix
authorsirvulcan <redacted>
Mon, 7 Aug 2006 13:29:52 +0000 (13:29 +0000)
committersirvulcan <redacted>
Mon, 7 Aug 2006 13:29:52 +0000 (13:29 +0000)
ChangeLog
src/chanserv.c

index 126c954601b3caada6e08739cfcc0c70923d37c0..0a81617b5c71403d744d061f4ab91a983d6dc5ed 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
 /***********************************************************************
  X3 ChangeLog
 
+2006-08-08  Neil Spierling  <sirvulcan@gmail.com>
+
+       * src/chanserv.c: Fixed a crash with giveownership. X3 would crash
+       if a giveownership command was issued in a channel with no owners.
+
 2006-08-07  Neil Spierling  <sirvulcan@gmail.com>
 
        * configure: Regenerated.
index 6fd959f829d48084ce18506fcafa49348fe1a9fb..1a871fb2cf2600e61bb453d87c0a5a1eacc0c122 100644 (file)
@@ -218,6 +218,7 @@ static const struct message_entry msgtab[] = {
     { "CSMSG_NO_SELF_CLVL", "You cannot change your own access." },
     { "CSMSG_NO_BUMP_ACCESS", "You cannot give users access greater than or equal to your own." },
     { "CSMSG_MULTIPLE_OWNERS", "There is more than one owner in %s; please use $bCLVL$b, $bDELOWNER$b and/or $bADDOWNER$b instead." },
+    { "CSMSG_NO_OWNER", "There is no owner for %s; please use $bCLVL$b and/or $bADDOWNER$b instead." },
     { "CSMSG_TRANSFER_WAIT", "You must wait %s before you can give ownership of $b%s$b to someone else." },
     { "CSMSG_NO_TRANSFER_SELF", "You cannot give ownership to your own account." },
     { "CSMSG_OWNERSHIP_GIVEN", "Ownership of $b%s$b has been transferred to account $b%s$b." },
@@ -6390,6 +6391,10 @@ static CHANSERV_FUNC(cmd_giveownership)
         reply("CSMSG_TRANSFER_WAIT", delay, channel->name);
         return 0;
     }
+    if (!curr_user) {
+        reply("CSMSG_NO_OWNER", channel->name);
+        return 0;
+    }
     if(!(new_owner_hi = modcmd_get_handle_info(user, argv[1])))
         return 0;
     if(new_owner_hi == user->handle_info)