From patchwork Fri Feb 19 20:49:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Prindeville X-Patchwork-Id: 1442448 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=q1u57Ec4; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Dj3fv1sCbz9sVv for ; Sat, 20 Feb 2021 07:52:22 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=V6D3d8PlnSNpzssrABKGpiHjy6Dtd1lLWBg9gdbtbKg=; b=q1u57Ec4a+SNHc03dljAe6Jtnj plTfd9bsmSsOLwaQv83c7mLlMtYjg0AbF+k6gGAg+IGuBI+o1bW8Ut9GqILyRb6ZNCGcTNIrFid9p O22JpEa3AIHfqKqUw1plaz71YV8yTzF3k2YjGqKnshxHveQmONkXyT2B9rszIBA0FRICDILGdZv5E UNzSkLH+G60u0BaLENLafNTSNaWz9fn8dwrw2qH4J55bVEVFVfQz3L3MZexwso+VAlyF/autQCefN GjeWIfSxaiPLDeQw26xpux22qa437rkRE6Ick9M2llhS34JW9Na7JkO14qHjMYn/hSDhZ3L6smp/2 WefE9YHQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lDCiZ-0004Xi-8V; Fri, 19 Feb 2021 20:49:39 +0000 Received: from mail.redfish-solutions.com ([45.33.216.244]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lDCiW-0004XO-I7 for openwrt-devel@lists.openwrt.org; Fri, 19 Feb 2021 20:49:37 +0000 Received: from ubuntu20.redfish-solutions.com (ubuntu20.redfish-solutions.com [192.168.4.33]) (authenticated bits=0) by mail.redfish-solutions.com (8.16.1/8.16.1) with ESMTPSA id 11JKnZ5b016163 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 19 Feb 2021 13:49:35 -0700 From: "Philip Prindeville" To: openwrt-devel@lists.openwrt.org Subject: [PATCH 1/1] firewall3: remove last remaining sprintf() Date: Fri, 19 Feb 2021 13:49:35 -0700 Message-Id: <20210219204935.88612-1-philipp@redfish-solutions.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 192.168.4.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210219_154936_800395_510F01F0 X-CRM114-Status: UNSURE ( 9.15 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Philip Prindeville Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: Philip Prindeville Signed-off-by: Philip Prindeville Reviewed-by: Rosen Penev --- iptables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iptables.c b/iptables.c index 9e8fa743c99f84222307128047d40d657916aa75..49b34394dfec4df361ec1cf6778cade831454c7c 100644 --- a/iptables.c +++ b/iptables.c @@ -1022,7 +1022,7 @@ fw3_ipt_rule_icmptype(struct fw3_ipt_rule *r, struct fw3_icmptype *icmp) #endif { if (icmp->code_min == 0 && icmp->code_max == 0xFF) - sprintf(buf, "%u", icmp->type); + snprintf(buf, sizeof(buf), "%u", icmp->type); else snprintf(buf, sizeof(buf), "%u/%u", icmp->type, icmp->code_min);