Repository navigation
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThe change adds a bounded path-separator helper and uses it in engine code and tools. Call sites return early when the path cannot be extended. ImagePacker also checks whether a selected folder path fits its buffer before adding it. ChangesPath separator handling
Priority: Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Possibly related PRs
Suggested labels: Suggested reviewers: Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
593cdef2-a43c-4435-a4d6-19a0f1ac6920
📒 Files selected for processing: 89
Core/GameEngine/Include/GameNetwork/FileTransfer.hCore/GameEngine/Source/Common/Audio/AudioEventRTS.cppCore/GameEngine/Source/Common/CRCDebug.cppCore/GameEngine/Source/Common/CommandLine.cppCore/GameEngine/Source/Common/INI/INI.cppCore/GameEngine/Source/Common/INI/INIMapCache.cppCore/GameEngine/Source/Common/MiniLog.cppCore/GameEngine/Source/Common/ReplaySimulation.cppCore/GameEngine/Source/Common/System/BIGFileSystem.cppCore/GameEngine/Source/Common/System/FileSystem.cppCore/GameEngine/Source/Common/System/GameMemoryInit.cppCore/GameEngine/Source/Common/WorkingDirectory.cppCore/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cppCore/GameEngine/Source/GameClient/MapUtil.cppCore/GameEngine/Source/GameLogic/Map/TerrainLogic.cppCore/GameEngine/Source/GameNetwork/FileTransfer.cppCore/GameEngine/Source/GameNetwork/GameInfo.cppCore/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cppCore/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cppCore/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cppCore/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cppCore/Libraries/Source/Lib/Debug.cppCore/Libraries/Source/Lib/Include/Lib/PathUtil.hCore/Libraries/Source/WWVegas/WW3D2/agg_def.cppCore/Libraries/Source/WWVegas/WW3D2/ringobj.cppCore/Libraries/Source/WWVegas/WW3D2/sphereobj.cppCore/Libraries/Source/WWVegas/WW3D2/w3d_dep.cppCore/Libraries/Source/WWVegas/WWAudio/AudibleSound.cppCore/Libraries/Source/WWVegas/WWAudio/Utils.hCore/Libraries/Source/WWVegas/WWDownload/FTP.cppCore/Libraries/Source/WWVegas/WWLib/WWCommon.hCore/Libraries/Source/WWVegas/WWLib/ffactory.cppCore/Tools/Autorun/Utils.cppCore/Tools/Autorun/Wnd_file.cppCore/Tools/ImagePacker/Source/ImagePacker.cppCore/Tools/ImagePacker/Source/WindowProcedures/DirectorySelect.cppCore/Tools/Launcher/DatGen/DatGen.cppCore/Tools/Launcher/findpatch.cppCore/Tools/Launcher/main.cppCore/Tools/Launcher/patch.cppCore/Tools/W3DView/GraphicView.cppCore/Tools/W3DView/MainFrm.cppCore/Tools/W3DView/SaveSettingsDialog.cppCore/Tools/W3DView/Utils.cppCore/Tools/W3DView/Utils.hCore/Tools/W3DView/W3DViewDoc.cppCore/Tools/WW3D/max2w3d/w3dutil.cppDependencies/Utility/Utility/stringex.hGenerals/Code/GameEngine/Source/Common/Recorder.cppGenerals/Code/GameEngine/Source/Common/StatsCollector.cppGenerals/Code/GameEngine/Source/Common/System/SaveGame/GameState.cppGenerals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cppGenerals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cppGenerals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cppGenerals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cppGenerals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cppGenerals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cppGenerals/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cppGenerals/Code/GameEngine/Source/GameLogic/System/GameLogic.cppGenerals/Code/Libraries/Source/WWVegas/WW3D2/part_ldr.cppGenerals/Code/Tools/GUIEdit/Source/GUIEdit.cppGenerals/Code/Tools/WorldBuilder/src/BuildList.cppGenerals/Code/Tools/WorldBuilder/src/SaveMap.cppGenerals/Code/Tools/WorldBuilder/src/ScriptDialog.cppGenerals/Code/Tools/WorldBuilder/src/TerrainMaterial.cppGenerals/Code/Tools/WorldBuilder/src/TerrainModal.cppGenerals/Code/Tools/WorldBuilder/src/WHeightMapEdit.cppGenerals/Code/Tools/WorldBuilder/src/WorldBuilderDoc.cppGeneralsMD/Code/GameEngine/Source/Common/Recorder.cppGeneralsMD/Code/GameEngine/Source/Common/StatsCollector.cppGeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cppGeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cppGeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cppGeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cppGeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cppGeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cppGeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cppGeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cppGeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/part_ldr.cppGeneralsMD/Code/Tools/GUIEdit/Source/GUIEdit.cppGeneralsMD/Code/Tools/WorldBuilder/src/BuildList.cppGeneralsMD/Code/Tools/WorldBuilder/src/MeshMoldOptions.cppGeneralsMD/Code/Tools/WorldBuilder/src/SaveMap.cppGeneralsMD/Code/Tools/WorldBuilder/src/ScriptDialog.cppGeneralsMD/Code/Tools/WorldBuilder/src/TerrainMaterial.cppGeneralsMD/Code/Tools/WorldBuilder/src/TerrainModal.cppGeneralsMD/Code/Tools/WorldBuilder/src/WHeightMapEdit.cppGeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilderDoc.cppGeneralsMD/Code/Tools/wdump/wdump.cpp
💤 Files with no reviewable changes: 3
- Core/GameEngine/Source/Common/System/FileSystem.cpp
- Core/Libraries/Source/WWVegas/WWAudio/Utils.h
- Core/GameEngine/Include/GameNetwork/FileTransfer.h
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
d85c07c to
eca20d8
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Handle appendPathSeparator failure before building the settings path. · W3DViewDoc.cpp:1449
Core/Tools/W3DView/W3DViewDoc.cpp:1449
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winHandle
appendPathSeparatorfailure before building the settings path.When the current directory length is
MAX_PATH - 1,appendPathSeparatorreturnsfalseand leavesszPathunchanged. The followingCStringconcatenation does not overflowszPath, but it creates a path without a separator. The profile writes can therefore target the wrong or unusable path, whileSaveSettingsstill returnsTRUEunconditionally.Suggested fix
- appendPathSeparator (szPath, ARRAY_SIZE (szPath)); + if (!appendPathSeparator (szPath, ARRAY_SIZE (szPath))) + { + return bReturn; + }
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
cb0ea6e5-3ac7-4355-a6c4-3ad1ac13ca7c
📒 Files selected for processing: 11
Core/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cppCore/Libraries/Source/Lib/Debug.cppCore/Libraries/Source/Lib/Include/Lib/PathUtil.hCore/Libraries/Source/debug/debug_debug.cppCore/Libraries/Source/debug/debug_io_flat.cppCore/Libraries/Source/debug/debug_stack.cppCore/Tools/W3DView/W3DViewDoc.cppGenerals/Code/Libraries/Source/WWVegas/WW3D2/part_ldr.cppGenerals/Code/Tools/WorldBuilder/src/WorldBuilderDoc.cppGeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/part_ldr.cppGeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilderDoc.cpp
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
eca20d8 to
791f588
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

Minor · Bound the duplicate-folder message. · DirectorySelect.cpp:210
Core/Tools/ImagePacker/Source/WindowProcedures/DirectorySelect.cpp:210
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winBound the duplicate-folder message.
The new check accepts a
toAddlength of 256–259 characters. If the user adds that folder again, thissprintfoverflowsmessage: the fixed text needs 36 characters, but the buffer reserves only 32 beyond_MAX_PATH. Use bounded formatting for this message too.Based on learnings: fixed-size path buffers must reserve space for appended characters and the terminator.
Source: Learnings

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
5663af13-3d32-48a4-8dca-41c1f58d8dc2
Files selected for processing: 11-
Core/Libraries/Source/Lib/Include/Lib/PathUtil.hCore/Libraries/Source/WWVegas/WW3D2/agg_def.cppCore/Libraries/Source/WWVegas/WWLib/ffactory.cppCore/Tools/Autorun/Wnd_file.cppCore/Tools/ImagePacker/Source/WindowProcedures/DirectorySelect.cppCore/Tools/W3DView/Utils.hCore/Tools/W3DView/W3DViewDoc.cppGenerals/Code/Tools/WorldBuilder/src/SaveMap.cppGenerals/Code/Tools/WorldBuilder/src/WHeightMapEdit.cppGeneralsMD/Code/Tools/WorldBuilder/src/SaveMap.cppGeneralsMD/Code/Tools/WorldBuilder/src/WHeightMapEdit.cpp
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
-
The duplicate folder message now uses snprintf too. |
DirectorySelectProcbuilds each folder to add withsprintf( toAdd, "%s%s\\", buffer, text ).bufferholds the current directory andtoAddis_MAX_PATHlong, so a long current directory plus a subfolder name writes pasttoAdd. When the current directory leaves no room for its trailing separator, the subfolder name is also joined to it without one.Now the path is built with
snprintf, and a folder whose path does not fit is skipped with a message. A current directory with no room for its separator always makestoAddoverflow, so the same check covers both cases.Reproduction:
Todo: