Bug 3197 - is_map_valid bug
is_map_valid bug
Status: RESOLVED WONTFIX
Product: AMX Mod X
Classification: Unclassified
Component: Core
trunk
PC All
: P4 major
Assigned To: amxmodx-bugs@alliedmods.net
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-16 08:43 PDT by GHW_Chronic
Modified: 2013-05-25 17:23 PDT (History)
4 users (show)

See Also:


Attachments

Description GHW_Chronic 2008-05-16 08:43:50 PDT
is_map_valid("<*") where * is a digit will always return true for some reason. Evidentally people were exploiting this and crashing servers using my custom nextmap plugin (or also possible that they just typed <3 in the server coincidentally and caused the error to trigger). I added a fix to the plugin that simply checks for unallowed filename characters ( / \ < > ^ * | ?).
Comment 1 sawce 2008-07-31 03:09:01 PDT
Interesting.

is_map_valid is just a wrapper around the engine api call.
Comment 2 Vincent Herbet [:Arkshine] 2010-12-20 13:08:03 PST
Yes, I confirm this bug, though that's more a bug in FS_FileExists(), so, the Steam file system. In most of the case, you won't encounter this issue and like said sawnce it's just a wrapper.

Looking at the engine code, what does pfnIsValidMap is : 

- check string is not null
- check if map length > 1 
- format the string to add "maps/" + ".bsp" and to keep 32 as max length
- Check if file exists.

My point is, if you need really something more safe to be used in a specific context, I suggest you do your own stock adding the extra checks you want and simply using file_exists() where the bug doesn't occur with it.

Note You need to log in before you can comment on or make changes to this bug.