[routing] Fix crash on 32-bit devices with conditional access

The deserialization of conditional road access data was using
size_t which is 8 bytes on 64-bit (where maps are generated)
but only 4 bytes on 32-bit devices. This caused stream
misalignment and eventual std::length_error when garbage data
was interpreted as a huge vector size.

Fix by using uint64_t to always read 8 bytes, matching what
64-bit build servers write.

Signed-off-by: Henry Sternberg <henry@bluelightmaps.com>
This commit is contained in:
Henry Sternberg
2026-01-08 16:09:21 +00:00
committed by Konstantin Pastbin
parent 0da7869c5b
commit e3abbc712b

View File

@@ -458,7 +458,7 @@ private:
positionsAccessConditional.clear();
auto openingHoursDeserializer = GetOpeningHoursSerDesForRouting();
auto const size = ReadPrimitiveFromSource<size_t>(src);
auto const size = ReadPrimitiveFromSource<uint64_t>(src);
positionsAccessConditional.reserve(size);
uint32_t prevFeatureId = 0;