From patchwork Wed Nov 4 17:43:22 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5599 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:30a9:b0:118:2077:975e with SMTP id f41csp741746laa; Wed, 4 Nov 2026 09:43:41 -0800 (PST) X-Forwarded-Encrypted: i=2; AKwUvBy4XUwxCMKVRRr37NMj6Xo+eE38RIWxoznqf9uNFcao4VwD3Ievz9Odv9NV3Z4oB478GLo0FYqrtIM=@openvpn.net X-Received: by 2002:a05:7300:5988:b0:369:ef92:bd7b with SMTP id 5a478bee46e88-36a42426236mr24717664eec.41.1793814221561; Wed, 04 Nov 2026 09:43:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793814221; cv=none; d=google.com; s=arc-20260327; b=JIosl+x/t/51hwF/MxhcXOg/rd51FU5raJqWChrTZztcN2a2ryIHtVtCSmLtbAxYk3 TLGf0uYKa1M65cGmjSwWmN/mds7bPW0sBU4ZwGv5K6e/93ltzj7oqdPdLOEDYjO4mh6o tXHHQs+LJYocJNqVTrjzpnaiDjiRrL991jlOSb85hyrDDmed7x9EcWPWqHTKvn5/NkFj u6JAEDbvKLHXeyjhBHCQM543NtKZ+BK9G37udV6C60fALn+dKbdeTMoy117xH4UZLub1 LGB3tOzSZw6QO5YpLESGr2wNSMZFpY89QV8Ey/BZ7RNQ/H+Y5R04QFAIZo/mRoj0rpDU vNxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=dPNU7pfGHMdzIK3jGCkwW/T6xCwMh2vaz7QiG0Tg8y4=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=dvIEC08ZSfT6eYx0rdQfJswbqarc+wptwsYeW9sI9ojFpCdUSxmvDXUTYVs+tuW4+S 6COxDXJoZ6Un4Ekccr3QDrc6Em8+Jm+anh7n/LqV/tIXQVgVvhQKnIr9dqndtllNExzH YxZnm4iADtAN7GnEo4DO45NJwl3riQfty0cu6gXdFN+iLjPELsFmP3+5afb/KJ11ajVM fR+GM0QnekrJHgbpxMbmSnBD7jL78vPdqQiZJK8KRO0FPHYLyzZSKKZ7GjPWpx62LmtP XrATWPwH99rdmmPDdRjIhQnZPvqF45ex6gU5vvdxavkS9exES4ekg2WT3xO46uySf5FY mp4Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b="Pc/cHcse"; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=OKIUXR+x; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=RzX1HL6j; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 5a478bee46e88-36ca390fb4dsi7268721eec.34.2026.11.04.09.43.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Nov 2026 09:43:41 -0800 (PST) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b="Pc/cHcse"; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=OKIUXR+x; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=RzX1HL6j; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=dPNU7pfGHMdzIK3jGCkwW/T6xCwMh2vaz7QiG0Tg8y4=; b=Pc/cHcseSPuhxZ hh0Guf3N36RiK/BjkWHyregd5QZAG6koiXkFQjNFDbyGPi3LBRILVOhYMVz0jQ01u0pzEU6UnFiaB MqUUXVtpyTJz5spOobXsUdP3Upfzmrf7WDZu9k+RMLgSiX3kDvyniT5ve2vJFk/rT+fnm6KQ31kM4 8w4=; Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.100.1) (envelope-from ) id 1xOf1Q-000000008PQ-22YG; Wed, 04 Nov 2026 17:43:40 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.100.1) (envelope-from ) id 1xOf1N-000000008PH-3iQb for openvpn-devel@lists.sourceforge.net; Wed, 04 Nov 2026 17:43:37 +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:References: In-Reply-To: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:List-Id:List-Help:List-Unsubscribe: List-Unsubscribe-Post:List-Subscribe:List-Post:List-Owner:List-Archive; bh=P8Mz5vQt/sFQDkYCvgkLMqDEk6EpjR/jbWjRrX2o//k=; b=OKIUXR+xY7n/h9TQfN4RsWJzQc PP1vsogdIfOFlsYMD44yn5YZaM31fR+MaHhtKLp7AYublH+DScIDlTSHdnbQrzHh0Ak8nneHWOmam DuvAkirOE0pEwUSnVIs1oV8t0lmxbmaD3NU8PBCJcBG6EJhw01ACJIPBOo61lOqm3C34=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: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:List-Id:List-Help:List-Unsubscribe:List-Unsubscribe-Post: List-Subscribe:List-Post:List-Owner:List-Archive; bh=P8Mz5vQt/sFQDkYCvgkLMqDEk6EpjR/jbWjRrX2o//k=; b=RzX1HL6j32T9ECdnyuFsi/lp9e uNwF4XfnNxK4DUWdEmFAK/6OzEkxTpRixbTTV0O+yh5kputKrzCJ3yfAdw8Wy24ZEuzDCxqNuOXz6 yFJcTRb7kwegUSfgA/GE3vuATuKoyG1IIznrFY38GmjzQeE/QnQCUR38OIovghe+ezlU=; Received: from [193.149.48.129] (helo=blue.greenie.muc.de) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.100.1) id 1xOf1L-000000000OH-0XuW for openvpn-devel@lists.sourceforge.net; Wed, 04 Nov 2026 17:43:36 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 6A4HhSdR015235 for ; Wed, 4 Nov 2026 18:43:28 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 6A4HhSwb015234 for openvpn-devel@lists.sourceforge.net; Wed, 4 Nov 2026 18:43:28 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Wed, 4 Nov 2026 18:43:22 +0100 Message-ID: <20261104174327.15221-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.55.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-1.hosts.colo.sdot.me", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Razvan Cojocaru gc_strdup() duplicated string_alloc() for its only caller. While here, fix the typos in the message_splitter() comment. Change-Id: Ib33ce23448959673affdfd462b4c2cfa9a015f55 Signed-off-by: Razvan Cojocaru Acked-by: Frank Lichtenheld Gerrit URL: https://gerrit.openvpn.net/c/o [...] Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1xOf1L-000000000OH-0XuW Subject: [Openvpn-devel] [PATCH v1] push_util: use string_alloc() instead of a local gc_strdup() 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 X-GMAIL-THRID: 1880950541165274659 X-GMAIL-MSGID: 1880950541165274659 From: Razvan Cojocaru gc_strdup() duplicated string_alloc() for its only caller. While here, fix the typos in the message_splitter() comment. Change-Id: Ib33ce23448959673affdfd462b4c2cfa9a015f55 Signed-off-by: Razvan Cojocaru Acked-by: Frank Lichtenheld Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2132 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2132 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Frank Lichtenheld diff --git a/src/openvpn/push_util.c b/src/openvpn/push_util.c index 34cb26c..0c27575 100644 --- a/src/openvpn/push_util.c +++ b/src/openvpn/push_util.c @@ -78,17 +78,8 @@ return buf; } -static char * -gc_strdup(const char *src, struct gc_arena *gc) -{ - char *ret = gc_malloc((strlen(src) + 1) * sizeof(char), true, gc); - - strcpy(ret, src); - return ret; -} - -/* It split the messagge (if necessary) and fill msgs with the message chunks. - * Return `false` on failure an `true` on success. +/* Split the message (if necessary) and fill msgs with the message chunks. + * Return `false` on failure and `true` on success. */ static bool message_splitter(const char *s, struct buffer_list *msgs, struct gc_arena *gc, const size_t safe_cap) @@ -98,7 +89,7 @@ return false; } - char *str = gc_strdup(s, gc); + char *str = string_alloc(s, gc); while (*str) {