From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121657 invoked by alias); 13 Mar 2015 18:14:39 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 121633 invoked by uid 89); 13 Mar 2015 18:14:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_FROM_URIBL_PCCC,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-ob0-f170.google.com Received: from mail-ob0-f170.google.com (HELO mail-ob0-f170.google.com) (209.85.214.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 13 Mar 2015 18:14:38 +0000 Received: by obcwp4 with SMTP id wp4so21458461obc.4; Fri, 13 Mar 2015 11:14:36 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.250.193 with SMTP id ze1mr39882842obc.70.1426270476333; Fri, 13 Mar 2015 11:14:36 -0700 (PDT) Received: by 10.60.146.129 with HTTP; Fri, 13 Mar 2015 11:14:36 -0700 (PDT) In-Reply-To: <1426269343.8624.206.camel@surprise> References: <1426269343.8624.206.camel@surprise> Date: Fri, 13 Mar 2015 18:14:00 -0000 Message-ID: Subject: Re: [PATCH, jit]: Robustify vasprintf error checks From: Uros Bizjak To: David Malcolm Cc: jit@gcc.gnu.org, "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-03/txt/msg00761.txt.bz2 On Fri, Mar 13, 2015 at 6:55 PM, David Malcolm wrote: >> As documented in [1] asprintf and vasprintf return: > I assume that we can rely that any vasprintf implementation manages on > failure to at least either write NULL to *ret or to return -1, even if > some of them fail to do both? Yes, this is correct. The patch checks both ways. Please also note that linux manpages claim that in case of error, *ret will be undefined, while FreeBSD implementation will set *ret to NULL on error. > OK for trunk. Thanks, commited. Uros.