external/hunspell: -fsanitize=shift

Change-Id: Ifc78a8f1a0a6fa29ef9becc5432e581f42241467
This commit is contained in:
Stephan Bergmann
2016-04-07 11:08:55 +02:00
parent 082005bf81
commit 16048590bb
2 changed files with 12 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ $(eval $(call gb_UnpackedTarball_set_tarball,hunspell,$(HUNSPELL_TARBALL)))
$(eval $(call gb_UnpackedTarball_add_patches,hunspell,\
external/hunspell/hunspell-solaris.patch \
external/hunspell/hunspell-windows.patch \
external/hunspell/ubsan.patch.0 \
))
ifeq ($(COM),MSC)

11
external/hunspell/ubsan.patch.0 vendored Normal file
View File

@@ -0,0 +1,11 @@
--- src/hunspell/csutil.cxx
+++ src/hunspell/csutil.cxx
@@ -281,7 +281,7 @@
u2->h = ((*u8 & 0x0f) << 4) + ((*(u8 + 1) & 0x3f) >> 2);
u8++;
if ((*(u8 + 1) & 0xc0) == 0x80) {
- u2->l = (*u8 << 6) + (*(u8 + 1) & 0x3f);
+ u2->l = (static_cast<unsigned char>(*u8) << 6) + (*(u8 + 1) & 0x3f);
u8++;
} else {
HUNSPELL_WARNING(stderr,