22.12.2012, 09:59
Quote:
The server didn't crash on line 87(CallLocalFunction) but on line 92, although the command text is a null string. But it is impossible because you can access the array of an null string, which actually contains (null) in the string. Thus I doubt it can be an invalid memory access.
Even if the index of the string (i.e. A in a_string[A]) is invalid, it will only return a warning of "array index out of boundaries", but not invalid memory access and crash the server. I will check it later. |
A "null string" in pawn is exactly the same as a string containing nothing - it's an array with one element, that being zero. Therefore in this case, cmdtext[0] is valid and would contain 0, but cmdtext[1] - which is trying to be accessed - is not.
Indeed it's strange that it's reported as "invalid memory access" rather than out of boundaries but I do believe that's the cause.