summaryrefslogtreecommitdiffstats
path: root/devel/ltrace/patches/0001-Fix-conditions-in-elf_read_u-16-32-64.patch
diff options
context:
space:
mode:
Diffstat (limited to 'devel/ltrace/patches/0001-Fix-conditions-in-elf_read_u-16-32-64.patch')
-rw-r--r--devel/ltrace/patches/0001-Fix-conditions-in-elf_read_u-16-32-64.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/devel/ltrace/patches/0001-Fix-conditions-in-elf_read_u-16-32-64.patch b/devel/ltrace/patches/0001-Fix-conditions-in-elf_read_u-16-32-64.patch
new file mode 100644
index 0000000000..2db685f5d3
--- /dev/null
+++ b/devel/ltrace/patches/0001-Fix-conditions-in-elf_read_u-16-32-64.patch
@@ -0,0 +1,29 @@
+From 8c3674c86688a79a8689772c3d0c84d6e7aaa118 Mon Sep 17 00:00:00 2001
+From: Petr Machata <pmachata@redhat.com>
+Date: Tue, 8 Jan 2013 23:22:49 +0100
+Subject: [PATCH] Fix conditions in elf_read_u{16,32,64}
+
+- The calling convention of need_data is 0 on success, <0 on failure.
+ The condition seems to have it all mixed, using both a ! and a
+ comparison.
+
+Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
+---
+ ltrace-elf.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ltrace-elf.c b/ltrace-elf.c
+index 29c204f3a0ca..0ecdc38b77f6 100644
+--- a/ltrace-elf.c
++++ b/ltrace-elf.c
+@@ -218,7 +218,7 @@ need_data(Elf_Data *data, GElf_Xword offset, GElf_Xword size)
+ int \
+ NAME(Elf_Data *data, GElf_Xword offset, uint##SIZE##_t *retp) \
+ { \
+- if (!need_data(data, offset, SIZE / 8) < 0) \
++ if (need_data(data, offset, SIZE / 8) < 0) \
+ return -1; \
+ \
+ if (data->d_buf == NULL) /* NODATA section */ { \
+--
+2.23.0