From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29420 invoked by alias); 11 Feb 2005 17:22:27 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 29356 invoked from network); 11 Feb 2005 17:22:23 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 11 Feb 2005 17:22:23 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j1BHMNAj013387 for ; Fri, 11 Feb 2005 12:22:23 -0500 Received: from pobox.surrey.redhat.com (pobox.surrey.redhat.com [172.16.10.17]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j1BHMMO16781 for ; Fri, 11 Feb 2005 12:22:22 -0500 Received: from localhost.localdomain.redhat.com (vpnuser9.surrey.redhat.com [172.16.9.9]) by pobox.surrey.redhat.com (8.12.8/8.12.8) with ESMTP id j1BHMLMR005290 for ; Fri, 11 Feb 2005 17:22:21 GMT To: binutils@sources.redhat.com Subject: Fix compile time warning in bfd/xsym.c From: Nick Clifton Date: Fri, 11 Feb 2005 19:49:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-02/txt/msg00256.txt.bz2 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 * 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)