This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
[PATCH] lib: Add missing config.h #include to crc32_file.c.
- From: Lei Zhang <thestig at google dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Fri, 17 Jan 2014 03:32:12 -0800
- Subject: [PATCH] lib: Add missing config.h #include to crc32_file.c.
Hi,
We have a large binary on a 32-bit host where the following command failed:
eu-strip -o foo.stripped -f foo.debug foo
eu-strip: while computing checksum for debug information: Invalid argument
Here, foo.debug is over 2 GB. The crc code called pread() with a
negative offset because crc32_file.c does not have LFS, off_t is only
32-bit, and the offset variable overflowed.
From db81c4d7b33b9045ff6f54fc7221f396f02e9d8a Mon Sep 17 00:00:00 2001
From: Lei Zhang <thestig@google.com>
Date: Fri, 17 Jan 2014 03:20:45 -0800
Subject: [PATCH] lib: Add missing config.h #include to crc32_file.c.
Without config.h, there is no possibility of large file support.
---
lib/crc32_file.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/crc32_file.c b/lib/crc32_file.c
index 9a168f6..c0b18e9 100644
--- a/lib/crc32_file.c
+++ b/lib/crc32_file.c
@@ -26,6 +26,10 @@
the GNU Lesser General Public License along with this program. If
not, see <http://www.gnu.org/licenses/>. */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include "system.h"
#include <errno.h>
#include <unistd.h>
--
1.8.5.2