public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [RFA] bfd/coffcode.h, (coff_set_alignment_hook): Check return of bfd_seek.
@ 2011-03-07 20:46 Michael Snyder
  2011-03-25 17:07 ` Nick Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Snyder @ 2011-03-07 20:46 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 35 bytes --]

Most such calls get checked.

OK?


[-- Attachment #2: coffcode.txt --]
[-- Type: text/plain, Size: 978 bytes --]

2011-03-07  Michael Snyder  <msnyder@vmware.com>

	* coffcode.h (coff_set_alignment_hook): Check return of bfd_seek.

Index: coffcode.h
===================================================================
RCS file: /cvs/src/src/bfd/coffcode.h,v
retrieving revision 1.172
diff -u -p -r1.172 coffcode.h
--- coffcode.h	18 Jan 2011 14:13:43 -0000	1.172
+++ coffcode.h	7 Mar 2011 20:44:25 -0000
@@ -1860,12 +1860,14 @@ coff_set_alignment_hook (bfd * abfd ATTR
       file_ptr oldpos = bfd_tell (abfd);
       bfd_size_type relsz = bfd_coff_relsz (abfd);
 
-      bfd_seek (abfd, (file_ptr) hdr->s_relptr, 0);
+      if (bfd_seek (abfd, (file_ptr) hdr->s_relptr, 0) != 0)
+	return;
       if (bfd_bread (& dst, relsz, abfd) != relsz)
 	return;
 
       coff_swap_reloc_in (abfd, &dst, &n);
-      bfd_seek (abfd, oldpos, 0);
+      if (bfd_seek (abfd, oldpos, 0) != 0)
+	return;
       section->reloc_count = hdr->s_nreloc = n.r_vaddr - 1;
       section->rel_filepos += relsz;
     }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFA] bfd/coffcode.h, (coff_set_alignment_hook): Check return of bfd_seek.
  2011-03-07 20:46 [RFA] bfd/coffcode.h, (coff_set_alignment_hook): Check return of bfd_seek Michael Snyder
@ 2011-03-25 17:07 ` Nick Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2011-03-25 17:07 UTC (permalink / raw)
  To: Michael Snyder; +Cc: binutils

Hi Michael,

> 2011-03-07  Michael Snyder<msnyder@vmware.com>
>
> 	* coffcode.h (coff_set_alignment_hook): Check return of bfd_seek.

Approved and applied.

Cheers
   Nick


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-25 17:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-07 20:46 [RFA] bfd/coffcode.h, (coff_set_alignment_hook): Check return of bfd_seek Michael Snyder
2011-03-25 17:07 ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).