fix(zone): lengths and counts in zone files are checked against what is left of the file

A string length, the path chunk's length and an object's render technique count are
compared with the bytes left before memory is set aside for them. The terrain reader
is built into dCommon, so every server that reads zone files has it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-11-10 17:41:01 -06:00
parent 4394497198
commit f70433c430
8 changed files with 76 additions and 6 deletions

View File

@@ -41,6 +41,8 @@ set(DCOMMON_SOURCES
"Permissions.cpp"
"PermissionGrants.cpp"
"NifFile.cpp"
# The terrain reader: every server that reads zone files uses it, not only the worlds
"${PROJECT_SOURCE_DIR}/dZoneManager/Raw.cpp"
)
# Workaround for compiler bug where the optimized code could result in a memcpy of 0 bytes, even though that isnt possible.
@@ -58,7 +60,7 @@ endforeach()
add_library(dCommon STATIC ${DCOMMON_SOURCES})
target_include_directories(dCommon
PUBLIC "." "dClient" "dEnums"
"${PROJECT_SOURCE_DIR}/dZoneManager" # Raw.h (ZoneScenes.h); its reader is dZoneManager's
"${PROJECT_SOURCE_DIR}/dZoneManager" # Raw.h and its reader
PRIVATE
"${PROJECT_SOURCE_DIR}/dDatabase/GameDatabase"
"${PROJECT_SOURCE_DIR}/dDatabase/GameDatabase/ITables"