Ok, you're protected against this case but the problem is not the ", is the ' '. If you try "alias ' ' a" all are valid characters, because the one_argument function returns a single space in arg, accepting alias the new alias as a valid one (space different from ~, ' and ") and saving next time "Alias a~" to disk. In the better case, when you read it you'll loose some data.
-----Mensaje original----- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] En nombre de Jason Gauthier Enviado el: sábado, 22 de marzo de 2003 2:26 Para: 'Carlos Moreno'; '[email protected]' Asunto: RE: ROM 'Crashing'... 30000/30000hp 35340/35360mp 32497/32504mv exp] alias ' ' " Invalid characters in alias. Don't even let them use it. if (strchr(argument, '~') || strchr(argument, '"')){ stc("Invalid characters in alias.\r\n", ch); return; } if (strchr(arg, '~') || strchr(arg, '\'') || strchr(arg, '"')){ stc("Invalid characters in alias.\r\n", ch); return; } > -----Original Message----- > From: Carlos Moreno [mailto:[EMAIL PROTECTED] > Sent: Friday, March 21, 2003 7:21 PM > To: [email protected] > Subject: ROM 'Crashing'... > > > Hello, > > There's a way to 'crash' any ROM... > > 1. With any player enter the command -> Alias ' ' " > 2. Quit > > ROM executes in fwrite_char: > > fprintf(fp,"Alias %s %s~\n", > ch->pcdata->alias[pos], > ch->pcdata->alias_sub[pos]); > > and writes to disk the line -> Alias "~ > > 3. Enter again.... > > ROM executes in fread_char > > ch->pcdata->alias[count] = > str_dup(fread_word(fp)); > ch->pcdata->alias_sub[count] = > str_dup(fread_word(fp)); > > The second fread_word fails with the "Fread_word: word > too long" > and exits. > > 4. ROM is down. > > One way to correct this is to add in the one_argument > function the next > lines: > > if ( *argument == '\'' || *argument == '"' ) > cEnd = *argument++; > > + while ( isspace(*argument) ) > + argument++; > > while ( *argument != '\0' ) > { > > PS: Sorry if that was already posted. > > > > > -- > ROM mailing list > [email protected] > http://www.rom.org/cgi-bin/mailman/listinfo/rom > -- ROM mailing list [email protected] http://www.rom.org/cgi-bin/mailman/listinfo/rom

