libexttextcat: fix overlapping memcpy
Change-Id: I3225043560a3c0e02345bc4e8a8d0f9cca2e3cd0
This commit is contained in:
@@ -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:
|
||||
|
16
libexttextcat/exttextcat-memcpy.patch.1
Normal file
16
libexttextcat/exttextcat-memcpy.patch.1
Normal file
@@ -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--;
|
Reference in New Issue
Block a user