Arkshine / AdminFreeLook

AMX Mod X module
GNU General Public License v2.0
10 stars 2 forks source link

Server Crashed. UTIL_StringToLower #5

Closed trollqaa closed 9 years ago

trollqaa commented 9 years ago

screen1 screen2

Hello. AdminFreeLook 1.5.4 installed and the server began to fall. In debug.log swears on module cstrike. Build Server 6153 beta Amxmodx 1.8.3 git4530

With version AdminFreeLook 1.5.3 no problems.

Debug.log file attached. I hope to fix it;)

Sorry for my English. I use google translate

Arkshine commented 9 years ago

I'm not sure what happens.

UTIL_StringToLower is used only by cstrike module here:

DETOUR_DECL_STATIC1(C_ClientCommand, void, edict_t*, pEdict) // void ClientCommand(edict_t *pEntity)
{
    const char *command = CMD_ARGV(0);

    // A new command is triggered, reset variable, always.
    CurrentItemId = 0;

    // Purpose is to retrieve an item id based on alias name or selected item from menu,
    // to be used in OnBuy* forwards.
    if ((ForwardOnBuyAttempt != -1 || ForwardOnBuy != -1) && command && *command)
    {
        // Just for safety.
        command = UTIL_StringToLower((char *)command);
...

I don't see how it can crash even though command is well checked before. Maybe for some reason it contains garbage.

Anyway, AdminFreeLook module doesn't do anything related to ClientCommand: it doesn't send commands, nor it hooks such function. So I'm not sure how this crash could be related to this module.

Are you absolutely sure it's because of this module? Tell me the context of the crash, how to reproduce it ? etc.

EDIT: I don't think crash is related to this module, but actually calling UTIL_StringToLower might a bad idea as it doesn't duplicate string and it doesn't check if letter is valid before, so it could lead to issues. I think I should fix cstrike module..

trollqaa commented 9 years ago

I just filled AdminFreeLook 1.5.4 and rebooted the server. And the server began to fall steadily. Thought that the case in version amxmodx, upgrade to the latest GIT. Server worked a little longer, and still fell, swearing cstrike. Then I rolled up to version 1.5.3 freelook all. No problem. The server is stable.

Arkshine commented 9 years ago

Check git4532+ ; I've removed UTIL_StringToLower from cstrike module. It was pointless and dangerous code as it is.

trollqaa commented 9 years ago

Thanks, I'll try. About the results are reported

trollqaa commented 9 years ago

Everything works well. Thank U! Sorry if off topic.