From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 466B6A04E7; Sun, 29 Nov 2020 18:55:40 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5CD8AC9AA; Sun, 29 Nov 2020 18:55:01 +0100 (CET) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by dpdk.org (Postfix) with ESMTP id 4B7ECC8FA for ; Sun, 29 Nov 2020 18:54:55 +0100 (CET) Received: by mail-pl1-f176.google.com with SMTP id x4so3443571pln.8 for ; Sun, 29 Nov 2020 09:54:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fKMan7oWGvWyjqMhG7qMLjXbclAI34cwErrXXBHsZqg=; b=KZN3Bpyvo/JYB3IR9N8Ca2cIE5s0f3+R8fu8FckBeVCbwZLegJ79rm8JL/5Pr9P4bg 37vlB8mCoinWWtp3tWUQmCF/3vVtB3w+FD9HupxNKRxa2yxdxNtOcGuhwqiAbanHtoVA NxuCIhMFxSS4SrWv7gp7MQlO4NA2wdSqhRpZ8/2SKXhDMuV2BqgwkcJh89C/Vuv2R5yj x8qu8g1N3CTPr1rOQjooEw3/1/yDlK+PTKfxG4LZm3Wq8jNyy9pM9XYjniHilLYZP4Y6 KYmPqVD9VMXUVRxDpfktXoBdcvhikPGz2ce15qVAC4poGExUVN5wIDGsvweu7INAFDWG I7Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fKMan7oWGvWyjqMhG7qMLjXbclAI34cwErrXXBHsZqg=; b=i7OPpokbJinETkcV9Mf9xEITA/20eTbgX68z4lyUascB2v4jnBPIz5s98CFOcQet1a Ox37Vmuw72g8rWNtNBm1aCbA8+25QvSPwNS3v/uq+6lWABuzwbeoI9xwB7DGEpEcDyUH 3us2OUqgqeRLsJT/ioZN6yguDZ6rr7sZ9Kj7VxadNa9dgQgCdHVYuverIfhmoEYOJKjm LjxSOm9SdBhdNbwrkrPgIF6oiPePINcWlJk1CwoN/I91RoV2jdzBAl6xtjRtTM6QboAK 10CYEfh8/IsliIJz8bWmQYOjADSyr5ors71PXRuD3OCrn1igtsU/xvwjM4G9NG547vxq UG9g== X-Gm-Message-State: AOAM530c2QtxrFE0BScp4KIEhB71VRKWzGvTP5cBvEBDLI+Uy/X8gNJL ZJikgrNFXl1m/eGsHlwHFDaI8fSGNbdYK4OC X-Google-Smtp-Source: ABdhPJwMR7ew7negeo/wPMMbcXB/jaMljgPa0dMSTJwY8tKwnqsuyVxcyOb0K+3mJA1VKe+f8ZK2OA== X-Received: by 2002:a17:902:854a:b029:da:113b:2d3f with SMTP id d10-20020a170902854ab02900da113b2d3fmr15571599plo.49.1606672493088; Sun, 29 Nov 2020 09:54:53 -0800 (PST) Received: from hermes.local (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id l23sm13114850pgn.40.2020.11.29.09.54.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2020 09:54:52 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , nikolay@cumulusnetworks.com Date: Sun, 29 Nov 2020 09:54:34 -0800 Message-Id: <20201129175437.15346-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201129175437.15346-1-stephen@networkplumber.org> References: <20201129175437.15346-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 2/5] bridge: fix string length warning X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Gcc-10 complains about possible string length overflow. This can't happen Ethernet address format is always limited to 18 characters or less. Just resize the temp buffer. Fixes: 70dfb0b8836d ("iplink: bridge: export bridge_id and designated_root") Cc: nikolay@cumulusnetworks.com Signed-off-by: Stephen Hemminger --- ip/iplink_bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c index 3e81aa059cb3..d12fd0558f7d 100644 --- a/ip/iplink_bridge.c +++ b/ip/iplink_bridge.c @@ -74,7 +74,7 @@ static void explain(void) void br_dump_bridge_id(const struct ifla_bridge_id *id, char *buf, size_t len) { - char eaddr[32]; + char eaddr[18]; ether_ntoa_r((const struct ether_addr *)id->addr, eaddr); snprintf(buf, len, "%.2x%.2x.%s", id->prio[0], id->prio[1], eaddr); -- 2.29.2