From patchwork Tue Feb 13 09:19:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Held X-Patchwork-Id: 1658 Return-Path: Received: from mail01.ipfire.org (unknown [172.28.1.200]) by web02.i.ipfire.org (Postfix) with ESMTP id CADEB61920 for ; Mon, 12 Feb 2018 23:20:16 +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 A84101140A3B; Mon, 12 Feb 2018 22:20:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 mail01.ipfire.org A84101140A3B 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 939FB1140A3C for ; Mon, 12 Feb 2018 22:19:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 mail01.ipfire.org 939FB1140A3C 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.228.114]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MHX0m-1eofpd1XMy-003JjS for ; Mon, 12 Feb 2018 23:19:37 +0100 From: Bernhard Held To: development@lists.ipfire.org Subject: [PATCH v2 1/4] Network::network_equal: fix check if array is fully defined Date: Mon, 12 Feb 2018 23:19:29 +0100 Message-Id: <20180212221932.29122-2-berny156@gmx.de> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180212221932.29122-1-berny156@gmx.de> References: <20180212221932.29122-1-berny156@gmx.de> X-Provags-ID: V03:K0:EU94Jza+K8+oWkpoCEPeyTQefbREyUWycHCP757RcW340TSilun QSBnRAvB3ZvRllMCvbqTCI/10HdS6bB32i8TVgXri00n4HOSBT/Lio4HAgccIDlErRPN5bC DBJf6XgrQge8POqwyffA7ZSHeiRGvztbtpD+jlqOtGebAYSRy4fC2wsXYdxKn1TE487Eejf SbXoy1PFXl43jiww/Kl8A== X-UI-Out-Filterresults: notjunk:1; V01:K0:DAED/JTEi2w=:orT2yM1TbPHxhXK94BcKaq Unur9QMEjStUQilVcDvRd2P8Lv4Wx0k9USBIL7MaCs6P5NkqTx1Ouae0AMIqf+5inp3Uf6Dgy q8ZgjD2PYR5zyfj4uHmLv+ze8Qltp5xXBXDlL0rvr5I0wWL5NrUvuVxQu/oBZ4S+26MhkNORf iDJDCIJH7rNkWU0bz8rG6n09WjHch+a3z40Q6tPS2LOP3rCaAwGPsANry1BsmU+sJw14O7I/e LH4/cGNMaGPcEvTbfmf2Cc8d2H5oDR8pG3jetlZHKXL4P8sXwyWptbinnf738ec+IWAOCL+p3 j3Rpa1cCv5y54luyvzYYsUpXSMuh5xLp2eftn6bn3pRFNVijSRq+btDuagFPs0jYi4YLfSN6Z 8q0Zs8akUzWFn3af0TScWam/J3BrNB1qCl1KIbU7N+okcq48j/urKSFBu/a5yKITnTlwbZo0L 9d0+aB7KNbBbt4AnDI0m9pk6jG7q01r6gp8XOizpG3wKOlL7rP6b5zd/i+nHK4nqYieaA+TYv Ck5eNAwUGCMHa+7trtbUbi+U9MZ9ouuOBHh39hgHgq4zDytDKXukD3d/OSVzNcCjplYA9clPb rz6LNacw49m7JQoN/FKW530s4JNTTV7IkGpGGsOdD+k5X5hmjNkVA6/ijkjlyxsragSTj4FZx slOr6IZHUf4SDwBC944MefgOZChlzGWaTL5i47fS4Opd7kJdGe6kvzHvUulGeiBlJkglmcaGi KtFI2QTrj/DWVX+7f7skOQjOEeQedBKl85NQ5WNLOmV4bt5joQzGcxtagFsw9vSjXAT3pM9v7 ILGIbAz3BwqHtoGNEUSPA62KR2cvw== 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..93bb646a6 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]) {