Re: Oh me god, what this be!

From: Daniel Koepke (dkoepke@CALIFORNIA.COM)
Date: 11/15/97


On Sat, 15 Nov 1997, Chuck Reed wrote:

->Program terminated with signal 11, Segmentation fault.
->#0  0x807f430 in strn_cmp (arg1=0x0, arg2=0x82aecf0 "", n=137002952)
                                  ^^^                 ^^

0x0 == NULL.  Now, here's a common sense question: can you do
something to nothing?  That is, could you pick up something that
doesn't exist?  Write with a pencil you don't have?  Look for a place
where you're calling 'strn_cmp' with an empty string.  Especially, new
code.  Eg., if you have something like:

  one_argument(argument, arg);
  if (!strn_cmp(arg, "redball", strlen(arg))) {
    .
    .
    .
  }

you never actually check to see if arg actually has something in it,
thus, if the command is called without arguments, you get arg == NULL,
and then you're trying to do something with nothing.


daniel koepke / dkoepke@california.com


     +------------------------------------------------------------+
     | 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