public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Fix compile time warning in bfd/xsym.c
@ 2005-02-11 19:49 Nick Clifton
  0 siblings, 0 replies; only message in thread
From: Nick Clifton @ 2005-02-11 19:49 UTC (permalink / raw)
  To: binutils

Hi Guys,

  I am applying the patch below to fix a compile time warning building
  bfd/xsym.c.  The problem was a call to memcpy() with a size of 0.
  It was not exactly clear from the code if this was intentional or a
  coding bug, so I chose to assume that the code was correct.  This
  may need to be revisited one day.

Cheers
  Nick

bfd/ChangeLog
2005-02-11  Nick Clifton  <nickc@redhat.com>

	* xsym.c (bfd_sym_parse_contained_variables_table_entry_v32):
	Avoid call to memcpy with a size of 0.

Index: bfd/xsym.c
===================================================================
RCS file: /cvs/src/src/bfd/xsym.c,v
retrieving revision 1.10
diff -c -3 -p -r1.10 xsym.c
*** bfd/xsym.c	31 Jan 2005 23:13:30 -0000	1.10
--- bfd/xsym.c	11 Feb 2005 17:19:00 -0000
*************** bfd_sym_parse_contained_variables_table_
*** 464,470 ****
--- 464,472 ----
  	}
        else if (entry->entry.la_size <= BFD_SYM_CVTE_SCA)
  	{
+ #if BFD_SYM_CVTE_SCA > 0
  	  memcpy (&entry->entry.address.lastruct.la, buf + 10, BFD_SYM_CVTE_SCA);
+ #endif
  	  entry->entry.address.lastruct.la_kind = buf[23];
  	}
        else if (entry->entry.la_size == BFD_SYM_CVTE_BIG_LA)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-02-11 17:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-11 19:49 Fix compile time warning in bfd/xsym.c 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).