AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Buffer overflow caused by using set_task incorrectly (https://forums.alliedmods.net/showthread.php?t=335355)

Natsheh 11-27-2021 22:26

Buffer overflow caused by using set_task incorrectly
 
Code:

L 11/28/2021 - 02:54:52: Invalid player id 100
L 11/28/2021 - 02:54:52: [AMXX] Run time error 10 (plugin "adminhelp.amxx") (native "client_print") - debug not enabled!
L 11/28/2021 - 02:54:52: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).


Bugsy 11-28-2021 01:04

Re: adminhelp error invalid id
 
Post some more info.

What else are you running on your server?
Which specific command caused the error? amx_help or amx_searchcmd

I've used this command for years and have never had an issue.

HamletEagle 11-28-2021 04:51

Re: adminhelp error invalid id
 
One would assume a coder would know to always enable debug mode when posting error logs

CrazY. 11-28-2021 07:02

Re: adminhelp error invalid id
 
You clearly tried to send a chat message to a game entity other than a player.

Yusochan 11-28-2021 07:47

Re: adminhelp error invalid id
 
Can you give more info to understand where is the problem ?

thEsp 11-28-2021 16:44

Re: adminhelp error invalid id
 
Quote:

Originally Posted by Yusochan (Post 2764523)
Can you give more info to understand where is the problem ?

Other than repeating #2, I'm really curious to know how would you help them?

@OP if you haven't modified the script then it must be a problem with the game itself, because client_print is only called inside @Task_DisplayMessage with the index passed from client_putinserver.

DJEarthQuake 11-28-2021 17:14

Re: adminhelp error invalid id
 
Quote:

Originally Posted by Natsheh (Post 2764493)
Invalid player id 100

Unfortunately this is nothing new. I have had, is_user_connected, in my copy of adminhelp for some time now.
PHP Code:

@Task_DisplayMessage(id)
if(
is_user_connected(id))
{
    
client_print(idprint_chat"%l""TYPE_HELP"HelpCommandSearchCommand);

    if (
CvarTimeLimit 0.0)
    {
        new 
timeleft get_timeleft();

        if (
timeleft 0)
        {
            
client_print(idprint_chat"%l""TIME_INFO_1"timeleft 60timeleft 60CvarNextmap);
        }
        else if (
CvarNextmap[0] != EOS)
        {
            
client_print(idprint_chat"%l""TIME_INFO_2"CvarNextmap);
        }
    }



Natsheh 11-29-2021 07:19

Re: adminhelp error invalid id
 
This is caused by a memory leak, but i am not sure why the player id is 100 and what causing the leak.

Quote:

Originally Posted by HamletEagle (Post 2764506)
One would assume a coder would know to always enable debug mode when posting error logs

Trust me debugging won't help in this situation.

Quote:

Originally Posted by Bugsy (Post 2764496)
Post some more info.

What else are you running on your server?
Which specific command caused the error? amx_help or amx_searchcmd

I've used this command for years and have never had an issue.

I am running a bunch of plugins, now i have some questions about freeing the handles, destroying arrays and tries, when creating a trie or an array or even a newmenu do i really need to destroy them in plugin end? Because I've heard they're destroyed inside the amxmodx module meaning that i don't really need to destroy them in plugin.

Natsheh 11-29-2021 10:19

Re: adminhelp error invalid id
 
I just found a bug in pluginmenu.sma when you've opened the cvars menu and then you disconnected the menu handler will be called with item (3rd param) equal to MENU_EXIT then a newmenu( pluginsmenu ) will be created but the displayment of the menu won't work because the player had already left the server.

fysiks 11-29-2021 20:13

Re: adminhelp error invalid id
 
Quote:

Originally Posted by Natsheh (Post 2764609)
This is caused by a memory leak

Where is your proof for claiming such a thing?


All times are GMT -4. The time now is 01:39.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.