Skip to content

OnLevelInit mapEntities / g_szMapEntities buffer too small and crashes for with some maps #1470

@rtldg

Description

@rtldg

Help us help you

  • I have checked that my issue doesn't exist yet.
  • I have tried my absolute best to reduce the problem-space and have provided the absolute smallest test-case possible.
  • I can always reproduce the issue with the provided description below.

Environment

  • Operating System version:
  • Game/AppID (with version if applicable):
  • Current SourceMod version:
  • Current SourceMod snapshot:
  • Current Metamod: Source snapshot:

Description

char g_szMapEntities[2097152]; (2 * 1024 * 1024) is too small for some maps and crashes (from strcpy(g_szMapEntities, pMapEntities); in SDKHooks::Hook_LevelInit probably)

Problematic Code (or Steps to Reproduce)

Try out bhop_miku_v2 or bhop_miku_csgo. These maps have about ~16 MiB of mapEntities

public Action OnLevelInit(const char[] mapName, char mapEntities[2097152])
{
	return Plugin_Continue;
}

Logs

  • Please attach in separate files: game output, library logs, kernel logs, and any other supporting information.
  • In case of a crash, please attach minidump or dump analyze output.

Metadata

Metadata

Assignees

Labels

Buggeneral bugs; can be anythingGood First IssueIssues that are suitable for first-time contributors.Help Wantedup for grabs

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions