diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-07-04 23:12:53 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-07-05 00:13:46 +0200 |
commit | 3bde0af3a8fd09defd47465d4b62541350cecc1c (patch) | |
tree | 930ba54accfc80f53b90f48af1b205b9a3422cd6 | |
parent | b832a7a78abd688ce465aa881b3b9e777d2ce8be (diff) |
libexttextcat: fix overlapping memcpy
Change-Id: I3225043560a3c0e02345bc4e8a8d0f9cca2e3cd0
-rw-r--r-- | libexttextcat/UnpackedTarball_exttextcat.mk | 1 | ||||
-rw-r--r-- | libexttextcat/exttextcat-memcpy.patch.1 | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/libexttextcat/UnpackedTarball_exttextcat.mk b/libexttextcat/UnpackedTarball_exttextcat.mk index ef90108f2913..1bf53fb1c567 100644 --- a/libexttextcat/UnpackedTarball_exttextcat.mk +++ b/libexttextcat/UnpackedTarball_exttextcat.mk @@ -13,6 +13,7 @@ $(eval $(call gb_UnpackedTarball_set_tarball,exttextcat,$(LIBEXTTEXTCAT_TARBALL) $(eval $(call gb_UnpackedTarball_add_patches,exttextcat,\ libexttextcat/android.patch \ + libexttextcat/exttextcat-memcpy.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/libexttextcat/exttextcat-memcpy.patch.1 b/libexttextcat/exttextcat-memcpy.patch.1 new file mode 100644 index 000000000000..b3e399a36072 --- /dev/null +++ b/libexttextcat/exttextcat-memcpy.patch.1 @@ -0,0 +1,16 @@ +fix overlapped memcpy in heapextract + +--- a/src/fingerprint.c 2013-07-04 22:53:25.674741538 +0200 ++++ b/src/fingerprint.c 2013-07-04 22:54:09.009741166 +0200 +@@ -254,7 +254,10 @@ + p = &(t->heap[0]); + + memcpy(item, p, sizeof(entry_t)); +- memcpy(&(t->heap[0]), &(t->heap[t->size - 1]), sizeof(entry_t)); ++ if (t->size > 1) ++ { ++ memcpy(&(t->heap[0]), &(t->heap[t->size - 1]), sizeof(entry_t)); ++ } + + siftdown(t, t->size, 0); + t->size--; |