From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12151 invoked by alias); 6 Mar 2011 00:36:17 -0000 Received: (qmail 12135 invoked by uid 22791); 6 Mar 2011 00:36:16 -0000 X-SWARE-Spam-Status: No, hits=-5.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 06 Mar 2011 00:36:11 +0000 Received: from mailhost4.vmware.com (mailhost4.vmware.com [10.16.67.124]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id A15473E001; Sat, 5 Mar 2011 16:36:07 -0800 (PST) Received: from msnyder-server.eng.vmware.com (promd-2s-dhcp138.eng.vmware.com [10.20.124.138]) by mailhost4.vmware.com (Postfix) with ESMTP id 9678DCA024; Sat, 5 Mar 2011 16:36:07 -0800 (PST) Message-ID: <4D72D6F7.1060501@vmware.com> Date: Sun, 06 Mar 2011 00:36:00 -0000 From: Michael Snyder User-Agent: Thunderbird 2.0.0.24 (X11/20101201) MIME-Version: 1.0 To: "gdb-patches@sourceware.org" , binutils@sourceware.org, "H.J. Lu" Subject: [RFA] bfd, compress.c (bfd_compress_section_contents): Check for out of mem. Content-Type: multipart/mixed; boundary="------------090902010108010108000908" Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2011-03/txt/msg00079.txt.bz2 This is a multi-part message in MIME format. --------------090902010108010108000908 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 58 Fail gracefully if not enough memory for operation. OK? --------------090902010108010108000908 Content-Type: text/plain; name="compress.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="compress.txt" Content-length: 801 2011-03-05 Michael Snyder * compress.c (bfd_compress_section_contents): Check for out of mem. Index: compress.c =================================================================== RCS file: /cvs/src/src/bfd/compress.c,v retrieving revision 1.7 diff -u -p -r1.7 compress.c --- compress.c 24 Dec 2010 10:40:19 -0000 1.7 +++ compress.c 6 Mar 2011 00:32:01 -0000 @@ -100,6 +100,12 @@ bfd_compress_section_contents (bfd *abfd compressed_size = compressBound (uncompressed_size) + 12; compressed_buffer = (bfd_byte *) bfd_malloc (compressed_size); + if (compressed_buffer == NULL) + { + bfd_set_error (bfd_error_no_memory); + return FALSE; + } + if (compress ((Bytef*) compressed_buffer + 12, &compressed_size, (const Bytef*) uncompressed_buffer, --------------090902010108010108000908--