From patchwork Thu Feb 15 06:35:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Held X-Patchwork-Id: 1667 Return-Path: Received: from mail01.ipfire.org (mail01.ipfire.org [IPv6:2001:470:7183:25::1]) by web02.i.ipfire.org (Postfix) with ESMTP id 172BD60C10 for ; Wed, 14 Feb 2018 20:36:14 +0100 (CET) X-Virus-Scanned: ClamAV at mail01.ipfire.org Received: from mail01.i.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id BC18B105FC87; Wed, 14 Feb 2018 19:36:18 +0000 (GMT) Authentication-Results: mail01.ipfire.org; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: mail01.ipfire.org; spf=pass smtp.mailfrom=development-bounces@lists.ipfire.org X-Virus-Scanned: ClamAV at mail01.ipfire.org Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 492F1108C3BC for ; Wed, 14 Feb 2018 19:35:54 +0000 (GMT) Authentication-Results: mail01.ipfire.org; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: mail01.ipfire.org; spf=pass smtp.mailfrom=berny156@gmx.de Received: from quad.berny.local ([46.244.233.56]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MA9Yv-1exLNy1kYz-00BMLR for ; Wed, 14 Feb 2018 20:35:31 +0100 From: Bernhard Held To: development@lists.ipfire.org Subject: [PATCH v3 1/4] Network::network_equal: fix check if array is fully defined Date: Wed, 14 Feb 2018 20:35:19 +0100 Message-Id: <20180214193522.26880-2-berny156@gmx.de> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180214193522.26880-1-berny156@gmx.de> References: <20180214193522.26880-1-berny156@g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uZiawaAgF9otO/pEashszYYUVFoK5JAUIjY Cg8TgnKWAQf5TTeUzZS37IhZ4fA9w== X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Correctly check length of list. Credit to Bernhard Bitsch for pointing in the right direction. --- config/cfgroot/network-functions.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/cfgroot/network-functions.pl b/config/cfgroot/network-functions.pl index 2902aabb0..070e14d0f 100644 --- a/config/cfgroot/network-functions.pl +++ b/config/cfgroot/network-functions.pl @@ -111,8 +111,9 @@ sub network_equal { my @bin1 = &network2bin($network1); my @bin2 = &network2bin($network2); - if (!defined $bin1 || !defined $bin2) { - return undef; + unless (scalar @bin1 == 2 && + scalar @bin2 == 2) { + return; } if ($bin1[0] eq $bin2[0] && $bin1[1] eq $bin2[1]) {