Skip to content

GameWindow: use-after-free on exiting the score overview window prematurely #831

Closed
@Caball009

Description

@Caball009

Prerequisites

  • I have searched for similar issues and confirmed this is not a duplicate

Game Version

  • Command & Conquer Generals
  • Command & Conquer Generals: Zero Hour
  • Other (please specify below)

Bug Description

I didn't test with Generals, but I assume it's exactly the same.

When exiting the score overview window before it's finished drawing, some (or all) of the GameWindow instances are deleted (deleteInstance), but still drawn apparently, which triggers the address sanitizer here:

const Image *winGetEnabledImage( Int index ) { return m_instData.m_enabledDrawData[ index ].image; }

Reproduction Steps

  1. Start a new skirmish game.
  2. Exit match.
  3. Don't let the score overview finish but exit to main screen.
  4. No visual sign but address sanitizer gets triggered because of use-after-free.

Additional Context

I was using windowed mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething is not working rightMajorSeverity: Minor < Major < Critical < BlockerMemoryIs memory related

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions