From patchwork Mon Mar 25 12:50:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 3669 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:c315:b0:55c:c090:46f0 with SMTP id jk21csp2405037mab; Mon, 25 Mar 2024 05:51:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUrj0vkCQt+ICcyk4vHS6mBy1hrfPhFubfeDgte6fkwOSasWz7toFChDncoxgmGQc84DbQOKW3obw+Qf2yWJMR0end03jY= X-Google-Smtp-Source: AGHT+IHmW6qI6GZa+5KNJB/ciDTaOihsa4hHEFr27ZZZqG0elG1kRAUGQ3tEwwsUPd6mbOX1a/b1 X-Received: by 2002:a05:6a21:9997:b0:1a3:6f51:378a with SMTP id ve23-20020a056a21999700b001a36f51378amr8415467pzb.5.1711371085747; Mon, 25 Mar 2024 05:51:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711371085; cv=none; d=google.com; s=arc-20160816; b=bRUEVw5O11XEpwzKprhbtE0O8v09HaqyhyC21/sPIegpt78ik+1xVvx+ynJhIzE/lv S2gKh+H7Y4kmYtdJtvYGfAAGtlVkMbG02l9aporZE0eQvemivDfKMXfBfsVP6c0fuVsX Z2Tyqpza/JYjJGY4AuGhYWMqzJACahiYdjUjZWGmt9hS4glZuwIpXn3Nu4xJgfpZ7+GI TXavgr4hVvgTNZkCVQPal+x2dCMgkWPSAXUH++wA5+VUyPq0dBjAP8kMJHlIzx/7el8A 3MDMC/EvcNzSTFnZ8VxUQvar8dSshTCAdWhppXyppqsrmMy6rqLf3JHWh9V6OPZF/zuG 1GuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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; bh=73t9iopbLwN/Zx96A4Lf3Q8bE4Aiu8f5STz0/pGG4tc=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=X2GF2pPG++QX4Ws2gXFlVUqgwZVrYyr5TmVwoQKEogN3JLlAIwWTysw8DSGYlRZgfU RW+GLElXKT+J89c3IreYwKCBfgELVfrubMBBzoxhUXEirnZXzGkx0yoeYg+FLZrJ2nW3 uWRjrtR13M9wzzKqtHNs53U18qCrPN3NCUkBgUnQEy3GLQ02i+pvKrblL0dltsub0XPK f7WQGy8e3NcKY3xsVvBe/VKHXi9dnZf7M1cHNWEKj8Z1mlwiwYQXzi2+ivTfZmgZv5Dm 6x9Zg2n6IQI3oGzK071hhG9uNu/j3PBv3z2gNsC4CCGbGBtA0XpDjs5RyqBART8OL2SS M14g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=CYiEup6s; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="X1FC4/s1"; 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 f24-20020a631f18000000b005ceea21d9ccsi7308506pgf.771.2024.03.25.05.51.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Mar 2024 05:51:25 -0700 (PDT) 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=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=CYiEup6s; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="X1FC4/s1"; 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 [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1rojnA-0000db-2w; Mon, 25 Mar 2024 12:51:08 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rojn8-0000dU-8A for openvpn-devel@lists.sourceforge.net; Mon, 25 Mar 2024 12:51:06 +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-Subscribe:List-Post:List-Owner:List-Archive; bh=tIPrXOrKTQsCUish/dOERc9NBvDP0WId2jW3O3bFMk4=; b=CYiEup6sAzCrBIfPnQbt1MzX+3 ZSm6+bJXxd7o5xiCU359h/Kb7FQUMssNcYkfsrP1cQDeNUERxpzpRpN3DVuwixBjPx6GHYDcfV5DH x3akjdUTysWSkfVbK8E2jCtqsRgr3efo/jCzZT6uVDHuAEoWeomOa0kO/ky6/GEQXdCM=; 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-Subscribe: List-Post:List-Owner:List-Archive; bh=tIPrXOrKTQsCUish/dOERc9NBvDP0WId2jW3O3bFMk4=; b=X1FC4/s15FKdPdJLg9X70WDhT4 YVb4nfc3gcJarIaKjX3cqD4kTBygBgxVHlteLAlvNhQ9/RXKuym7JK7jC9SygU/AVyp+ZuEBoA7oz W9FHTqPJB7SAZ3wvM6X6yabC075JB/bLzWC8kX/ZORXq6y3fsd2MCRgSf6KlBPQvNqQw=; Received: from dhcp-174.greenie.muc.de ([193.149.48.174] helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1rojn6-0004JO-Ka for openvpn-devel@lists.sourceforge.net; Mon, 25 Mar 2024 12:51:06 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.17.1.9/8.17.1.9) with ESMTP id 42PCorkw014145 for ; Mon, 25 Mar 2024 13:50:53 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 42PCorIc014144 for openvpn-devel@lists.sourceforge.net; Mon, 25 Mar 2024 13:50:53 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Mon, 25 Mar 2024 13:50:52 +0100 Message-ID: <20240325125052.14135-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.43.2 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: -0.0 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", 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: Arne Schwabe This is avoid a warning/error (when using -Werror) under current macOS of sprintf: __deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.") Content analysis details: (-0.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-Headers-End: 1rojn6-0004JO-Ka Subject: [Openvpn-devel] [PATCH v1] Use snprintf instead of sprintf for get_ssl_library_version 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: =?utf-8?q?1794502647613908152?= X-GMAIL-MSGID: =?utf-8?q?1794502647613908152?= From: Arne Schwabe This is avoid a warning/error (when using -Werror) under current macOS of sprintf: __deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.") Change-Id: I3c6fd36eb9daee9244d6dc6d9f22de1c5cf9d039 Signed-off-by: Arne Schwabe Acked-by: Frank Lichtenheld --- 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/+/545 This mail reflects revision 1 of this Change. Signed-off-by line for the author was added as per our policy. Acked-by according to Gerrit (reflected above): Frank Lichtenheld diff --git a/src/openvpn/ssl_mbedtls.c b/src/openvpn/ssl_mbedtls.c index b44ddd5..0730d25 100644 --- a/src/openvpn/ssl_mbedtls.c +++ b/src/openvpn/ssl_mbedtls.c @@ -1614,7 +1614,7 @@ { static char mbedtls_version[30]; unsigned int pv = mbedtls_version_get_number(); - sprintf( mbedtls_version, "mbed TLS %d.%d.%d", + snprintf(mbedtls_version, sizeof(mbedtls_version), "mbed TLS %d.%d.%d", (pv>>24)&0xff, (pv>>16)&0xff, (pv>>8)&0xff ); return mbedtls_version; }