From patchwork Fri Apr 2 06:34:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 1704 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director11.mail.ord1d.rsapps.net ([172.27.255.50]) by backend30.mail.ord1d.rsapps.net with LMTP id 4N0TM+taZ2D5YwAAIUCqbw (envelope-from ) for ; Fri, 02 Apr 2021 13:56:59 -0400 Received: from proxy14.mail.iad3a.rsapps.net ([172.27.255.50]) by director11.mail.ord1d.rsapps.net with LMTP id EPX5MutaZ2A4XQAAvGGmqA (envelope-from ) for ; Fri, 02 Apr 2021 13:56:59 -0400 Received: from smtp50.gate.iad3a ([172.27.255.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy14.mail.iad3a.rsapps.net with LMTPS id SLSjHu1aZ2BEHQAA1+b4IQ (envelope-from ) for ; Fri, 02 Apr 2021 13:57:01 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp50.gate.iad3a.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=greenie.muc.de X-Suspicious-Flag: YES X-Classification-ID: d12df3fa-93dc-11eb-bc81-525400c2fb51-1-1 Received: from [216.105.38.7] ([216.105.38.7:44000] helo=lists.sourceforge.net) by smtp50.gate.iad3a.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 43/03-17583-AEA57606; Fri, 02 Apr 2021 13:56:58 -0400 Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.92.3) (envelope-from ) id 1lSO1c-0001Q8-FO; Fri, 02 Apr 2021 17:56:04 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1lSO1Q-0001L0-KA for openvpn-devel@lists.sourceforge.net; Fri, 02 Apr 2021 17:55:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=WcO9jMBynzrV9hawxijZkkMoxbHBZ21olkAwbwmBpRI=; b=L5EVHgBVA1pX8CiMmqUaRU8tse D6LY63MqVmrGzIt20kx+Po47Uxa8XK5nvPoJpSyg/87CsyoEovtBnefM/X2tG4Lb/CC/m9bfVsJXU aSJEkvCVueqPc5W61uC4oeu5vblgs4dczCg5Y2nQiADuhOjnJa44JyloytplwQdV8RyU=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:To:From: Sender:Reply-To:Cc:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=WcO9jMBynzrV9hawxijZkkMoxbHBZ21olkAwbwmBpRI=; b=H XRPtIwSUswqLNELLQEurTb4jqvNjCJ2N2FZHjbLn44hGx/tewzTZqN7PHc+/hjFU+Dki0gPQCRux7 9pRLIH8XvKmp+DKBUjM6C5Q8i5nW2g1VWFaeub/bUYlKhsdCOyyCkuBRNszwxUFJ6B/WvGL1y0AeI QB1CUWq72IG1FNhs=; Received: from dhcp-174.greenie.muc.de ([193.149.48.174] helo=blue.greenie.muc.de) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1lSNgg-007fSL-Rl for openvpn-devel@lists.sourceforge.net; Fri, 02 Apr 2021 17:34:51 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.15.2/8.14.9) with ESMTP id 132HYFQU014265 for ; Fri, 2 Apr 2021 19:34:16 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.15.2/8.14.9/Submit) id 132HYFwr014264 for openvpn-devel@lists.sourceforge.net; Fri, 2 Apr 2021 19:34:15 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Fri, 2 Apr 2021 19:34:14 +0200 Message-Id: <20210402173414.14216-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 TIME_LIMIT_EXCEEDED Exceeded time limit / deadline X-Headers-End: 1lSNgg-007fSL-Rl Subject: [Openvpn-devel] [PATCH] Fix potential NULL ptr crash if compiled with DMALLOC X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox In the unlikely case that we are compiled with -DDMALLOC *and* malloc() returns NULL, there is an uncaught memset() which would crash then. Remove the memset(), as the right the next operation after check_malloc_return() is a mempcy() which will overwrite the whole memory block anyway. Trac: #586 Signed-off-by: Gert Doering Acked-by: Antonio Quartulli --- src/openvpn/buffer.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/openvpn/buffer.c b/src/openvpn/buffer.c index 48bf25d5..e7031a4f 100644 --- a/src/openvpn/buffer.c +++ b/src/openvpn/buffer.c @@ -706,7 +706,6 @@ string_alloc(const char *str, struct gc_arena *gc) */ #ifdef DMALLOC ret = openvpn_dmalloc(file, line, n); - memset(ret, 0, n); #else ret = calloc(1, n); #endif