From 62b76e4b6e0b4cb5b3e0053d1de4097b32577049 Mon Sep 17 00:00:00 2001
From: Nick Clifton <nickc@redhat.com>
Date: Thu, 15 Jun 2017 13:08:47 +0100
Subject: [PATCH] Fix address violation parsing a corrupt ieee binary.

	PR binutils/21581
	(ieee_archive_p): Use a static buffer to avoid compiler bugs.

Upstream-Status: Backport
CVE: CVE-2017-9747
Signed-off-by: Armin Kuster <akuster@mvista.com>

---
 bfd/ChangeLog | 2 ++
 bfd/ieee.c    | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

Index: git/bfd/ieee.c
===================================================================
--- git.orig/bfd/ieee.c
+++ git/bfd/ieee.c
@@ -1357,7 +1357,7 @@ ieee_archive_p (bfd *abfd)
 {
   char *library;
   unsigned int i;
-  unsigned char buffer[512];
+  static unsigned char buffer[512];
   file_ptr buffer_offset = 0;
   ieee_ar_data_type *save = abfd->tdata.ieee_ar_data;
   ieee_ar_data_type *ieee;
Index: git/bfd/ChangeLog
===================================================================
--- git.orig/bfd/ChangeLog
+++ git/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2017-06-15  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/21581
+       (ieee_archive_p): Likewise.
+
 2017-06-14  Nick Clifton  <nickc@redhat.com>
  
        PR binutils/21578
