diff --git a/external/libeot/UnpackedTarball_libeot.mk b/external/libeot/UnpackedTarball_libeot.mk index 9a781c99798f..40ac1cbb0b94 100644 --- a/external/libeot/UnpackedTarball_libeot.mk +++ b/external/libeot/UnpackedTarball_libeot.mk @@ -10,6 +10,7 @@ libeot_patches := libeot_patches += 0001-remove-unused-err.h.patch libeot_patches += debug-no-werror.patch.0 +libeot_patches += ubsan.patch.0 $(eval $(call gb_UnpackedTarball_UnpackedTarball,libeot)) diff --git a/external/libeot/ubsan.patch.0 b/external/libeot/ubsan.patch.0 new file mode 100644 index 000000000000..62673c275ca9 --- /dev/null +++ b/external/libeot/ubsan.patch.0 @@ -0,0 +1,11 @@ +--- src/EOT.c ++++ src/EOT.c +@@ -12,7 +12,7 @@ + + uint32_t EOTreadU32LE(const uint8_t *bytes) + { +- return bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24); ++ return ((uint32_t)bytes[0]) | (((uint32_t)bytes[1]) << 8) | (((uint32_t)bytes[2]) << 16) | (((uint32_t)bytes[3]) << 24); + } + + uint16_t EOTreadU16LE(const uint8_t *bytes)