Minor Problems with bpl10

From: James Kane (jkane@muffin.wis.com)
Date: 03/20/96

After poking around with the new patch, I found a couple small bugs that 
should probably be addressed.  First, skillset allows you to modify any 
positive array index.  Thus you can set the fire breath skill, which 
corresponds roughly to talks[0] and so on.  To fix this either do_skillset 
needs to be changed toaccept only skill <= MAX_SKILLS or find_skill_num() 
needs modification. I opted to change the following in do_skillset:

Changed modify.c line 135 from:
    for (i = 0; *spells[i] != '\n'; i++) {
    for (i = 0; i <= MAX_SKILLS; i++) {
and changed modify.c line 176 from:  
    if ((skill = find_skill_num(help)) <= 0) {
to:  if ((skill = find_skill_num(help)) <= 0 || skill > MAX_SKILLS) {

This works quite well, I think.  If I get time I'll run through the code 
and see if there are any other places where array boundaries are being over

The other isn't really a big deal but it annoyed me a bit when I added 
code to allow builders to set mobile's skills.  The culprit is do_restore 
and the code that sets an immortals skills to 100 and the abils to 25.  
Since you can't set mob skills in the standard source this may have gone 
unnoticed, but if abils are used on mobs (I haven't looked at that yet) 
this could be giving high level mobs a pretty hefty power boost, if a 
greater god restores them.

changed line 1243 from:
    if ((GET_LEVEL(ch) >= LVL_GRGOD) && (GET_LEVEL(vict) >= LVL_IMMORT)) {
    if ((GET_LEVEL(ch) >= LVL_GRGOD) && !IS_NPC(vict) &&
        (GET_LEVEL(vict) >= LVL_IMMORT)) {

This archive was generated by hypermail 2b30 : 12/07/00 PST