Inputtext server crash help
#1

Hi,
Some people enters my server and write /changepass.

When they write "-_;akasd-_;akasd-_;akasd-_;akasd-_;akasdasdL;;@#L,,llasdkxkad" this 3-4 times, server crashes.

Function hashes this using udb_hash

pawn Код:
stock udb_hash(buf[]) {
    new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n<length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}
and write the result with Y_INI.

What is the problem ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)