Re: Re[2]: [MULTI PATCH] Crashes withGeorge'sPatch

From: Davies, Nathan (DaviesN@AECL.CA)
Date: 10/09/97


Ya, that part was taken right from George's multiple patch, and they are
arrays, not pointers...and those are the only strcpy's in that
function...but it shouldn't get to that section regardless since the
command is get all corpse and arg1 != isnumber...

<boggle>

Thanks,
>Nathan Davies,

>>(gdb) backtrace
>>#0  0x4007643f in strcpy ()
>>#1  0x81a9690 in ?? ()
>
> this right here would seem to be the problem (the above two lines).
>it would appear, that in your do_get function, or a little deeper into it
>you are trying to copy either
>a) into a NULL pointer, or
>b) from a NULL pointer.
>that would be something like
>
>char *arg = NULL;
>strcpy(buf, arg);
>
>you would get something like that.
>i would suggest stepping through (oops, you don't know how to use GDB yet).
>umm.. . . well i would suggest putting a lot of
>log()'s into the function.
>
>like
>log("about to strcpy at this line.");
>strcpy(yadda, yaddaa);
>log("this ones ok.");
>it shouldn't be too hard, if you know how to run on a separate port,
>and can EASILY recreate the bug.
>
>if you STILL can't get it figured out,
>here's an idea.
>
>it may be in this section in do_get
>
>    int amount = 1;
>    if (is_number(arg1)) {
>      amount = atoi(arg1);
>      strcpy(arg1, arg2);
>      strcpy(arg2, arg3);
>    }
>did you make sure that arg1, arg2, arg3 are NOT pointers?
>char *arg1;
>they are supposed to be
>char arg1[MAX_INPUT_LENGTH];
>..
>..
>char arg3[MAX_INPUT_LENGTH];
>
>be VERY careful with this kinda thing.
>
>have fun,
>and
>Code On
>Akuma the Raging Coder
>


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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