Skip to content

Commit 39647c3

Browse files
fix(logic): Improve validation of MSG_SET_RALLY_POINT in GameLogicDispatch (TheSuperHackers#2441)
1 parent 33a7eec commit 39647c3

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

Generals/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,21 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData )
520520
{
521521
Object *obj = findObjectByID( msg->getArgument( 0 )->objectID );
522522
Coord3D dest = msg->getArgument( 1 )->location;
523+
523524
if (obj)
524525
{
526+
#if !RETAIL_COMPATIBLE_CRC
527+
// TheSuperHackers @fix stephanmeesters 11/03/2026 Validate the owner of the source object
528+
if ( obj->getControllingPlayer() != thisPlayer )
529+
{
530+
DEBUG_CRASH( ("MSG_SET_RALLY_POINT: Player '%ls' attempted to set the rally point of object '%s' owned by player '%ls'.",
531+
thisPlayer->getPlayerDisplayName().str(),
532+
obj->getTemplate()->getName().str(),
533+
obj->getControllingPlayer()->getPlayerDisplayName().str()) );
534+
break;
535+
}
536+
#endif
537+
525538
doSetRallyPoint( obj, dest );
526539
}
527540

GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,8 +523,21 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData )
523523
{
524524
Object *obj = findObjectByID( msg->getArgument( 0 )->objectID );
525525
Coord3D dest = msg->getArgument( 1 )->location;
526+
526527
if (obj)
527528
{
529+
#if !RETAIL_COMPATIBLE_CRC
530+
// TheSuperHackers @fix stephanmeesters 11/03/2026 Validate the owner of the source object
531+
if ( obj->getControllingPlayer() != thisPlayer )
532+
{
533+
DEBUG_CRASH( ("MSG_SET_RALLY_POINT: Player '%ls' attempted to set the rally point of object '%s' owned by player '%ls'.",
534+
thisPlayer->getPlayerDisplayName().str(),
535+
obj->getTemplate()->getName().str(),
536+
obj->getControllingPlayer()->getPlayerDisplayName().str()) );
537+
break;
538+
}
539+
#endif
540+
528541
doSetRallyPoint( obj, dest );
529542
}
530543

0 commit comments

Comments
 (0)