mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 23:33:12 +09:00
Harden minimap tile storage paths
This commit is contained in:
1 parent
78fc90d7a0
commit
3f8ef85987
2 files changed
+111
-30
No files matched your search
@@ -159,6 +159,9 @@ async function processChunkData(
|
||||
offset += 1;
|
||||
const length = readUInt16BE(tileData, offset);
|
||||
offset += 2;
|
||||
if (offset + length > tileData.length) {
|
||||
return { success: false, newOffset: offset };
|
||||
}
|
||||
offset += length; // Skip chunk data
|
||||
return { success: true, newOffset: offset };
|
||||
}
|
||||
@@ -327,6 +330,9 @@ export function extractAvailableTicks(tileData: BinaryData): number[] {
|
||||
offset += 1;
|
||||
const length = readUInt16BE(tileData, offset);
|
||||
offset += 2;
|
||||
if (offset + length > tileData.length) {
|
||||
break;
|
||||
}
|
||||
offset += length; // Skip chunk data
|
||||
} else if (type === 2) { // Pixels
|
||||
if (offset + 10 > tileData.length) {
|
||||
|
||||
Reference in new issue
Block a user