[{"id":27606,"web_url":"https://patchwork.libcamera.org/comment/27606/","msgid":"<169027601422.3467343.15277065655520739840@Monstersaurus>","date":"2023-07-25T09:06:54","subject":"Re: [libcamera-devel] [PATCH] libcamera: yaml: Increase the YAML\n\tparser limit","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Naushir Patuck via libcamera-devel (2023-07-25 10:03:16)\n> Increase the maximum list size to 2000 elements. This allows, for\n> example, larger lens shading config structures to be parsed correctly\n> without throwing any errors.\n> \n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  src/libcamera/yaml_parser.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/yaml_parser.cpp b/src/libcamera/yaml_parser.cpp\n> index 153a6d53c3f9..bf21141e20bb 100644\n> --- a/src/libcamera/yaml_parser.cpp\n> +++ b/src/libcamera/yaml_parser.cpp\n> @@ -676,7 +676,7 @@ int YamlParserContext::parseDictionaryOrList(YamlObject::Type type,\n>          * Add a safety counter to make sure we don't loop indefinitely in case\n>          * the YAML file is malformed.\n>          */\n> -       for (unsigned int sentinel = 1000; sentinel; sentinel--) {\n> +       for (unsigned int sentinel = 2000; sentinel; sentinel--) {\n>                 auto evt = nextEvent();\n>                 if (!evt)\n>                         return -EINVAL;\n> -- \n> 2.34.1\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id BB0C6BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 25 Jul 2023 09:06:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E89D4628C0;\n\tTue, 25 Jul 2023 11:06:58 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ED3CC600F7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 25 Jul 2023 11:06:56 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BD4F54E6;\n\tTue, 25 Jul 2023 11:05:58 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1690276018;\n\tbh=Iw3u03DGPKAsg+NuBZrQt/1hz9LtBmwHI87Fa5YrnIQ=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=oymRWADzcfV9V4yhmvNDlK5vH7qRoV7SJOFlr2r6V0NsBRqjRYUcOEXcnI8Q5AR55\n\tJQFuNL7N+gbaQaZJ5SDZlVM7A5P3YfgyE3VmCqhOCoavRO4WOaTwqTiKP5TFibh2Px\n\tVd/jnk/PXLmls2Qck8z/w95PIvIb+QVegXjk4SdCZ0IFJhZxcDoqOKnKBKt13Uu/wT\n\to799RoBsVLMPDsbv8Q2pbslx/O5k/ZWsj0Omac2qiFWoY7lHFM3xKhyy0pURx+F1J2\n\tg9ZUjKkXZ3urKZZ/caKodFXAXveN5vZGkPNdtNzWQ7Z4txi6HTqbW1p/9O5pqws2yi\n\tVgXLciLgEh18g==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1690275958;\n\tbh=Iw3u03DGPKAsg+NuBZrQt/1hz9LtBmwHI87Fa5YrnIQ=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=UNz1RggcCNHixQKDSFq4hjl6RJI/qnTaCtLwPJ8vARFmf8X2o97sCE1pWKDnigPdP\n\tm8KWLiDq3tJLz9moGqTGQ2K2MtzdVTDkbC3OojKvQkELQpz5975xkFXBMF3VnCYYs4\n\tCiDQ6oOYtBLldwPpmSCllXNIq+5q6OwBSXeyuLsc="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"UNz1Rggc\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20230725090316.29758-1-naush@raspberrypi.com>","References":"<20230725090316.29758-1-naush@raspberrypi.com>","To":"Naushir Patuck <naush@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Tue, 25 Jul 2023 10:06:54 +0100","Message-ID":"<169027601422.3467343.15277065655520739840@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH] libcamera: yaml: Increase the YAML\n\tparser limit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27627,"web_url":"https://patchwork.libcamera.org/comment/27627/","msgid":"<20230727213255.GN25174@pendragon.ideasonboard.com>","date":"2023-07-27T21:32:55","subject":"Re: [libcamera-devel] [PATCH] libcamera: yaml: Increase the YAML\n\tparser limit","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Tue, Jul 25, 2023 at 10:06:54AM +0100, Kieran Bingham via libcamera-devel wrote:\n> Quoting Naushir Patuck via libcamera-devel (2023-07-25 10:03:16)\n> > Increase the maximum list size to 2000 elements. This allows, for\n> > example, larger lens shading config structures to be parsed correctly\n> > without throwing any errors.\n> > \n> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nWe should improve this at some point, as bumping the limit from a random\nvalue to a higher random value doesn't seem to be a great future-proof\noption :-) For now,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> > ---\n> >  src/libcamera/yaml_parser.cpp | 2 +-\n> >  1 file changed, 1 insertion(+), 1 deletion(-)\n> > \n> > diff --git a/src/libcamera/yaml_parser.cpp b/src/libcamera/yaml_parser.cpp\n> > index 153a6d53c3f9..bf21141e20bb 100644\n> > --- a/src/libcamera/yaml_parser.cpp\n> > +++ b/src/libcamera/yaml_parser.cpp\n> > @@ -676,7 +676,7 @@ int YamlParserContext::parseDictionaryOrList(YamlObject::Type type,\n> >          * Add a safety counter to make sure we don't loop indefinitely in case\n> >          * the YAML file is malformed.\n> >          */\n> > -       for (unsigned int sentinel = 1000; sentinel; sentinel--) {\n> > +       for (unsigned int sentinel = 2000; sentinel; sentinel--) {\n> >                 auto evt = nextEvent();\n> >                 if (!evt)\n> >                         return -EINVAL;","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 389BABDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 27 Jul 2023 21:32:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8141A627DF;\n\tThu, 27 Jul 2023 23:32:51 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DCA0261EB0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 27 Jul 2023 23:32:49 +0200 (CEST)","from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi\n\t[213.243.189.158])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D1B122E4;\n\tThu, 27 Jul 2023 23:31:49 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1690493571;\n\tbh=bTS8AjgbUIBi52E4EZh3KSP9RUQ2GccYQQ/dUfm0RRY=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=MVRrPzxuM4SsNOj8JMiBvhpScyIpIkq1O1NQLtoq8w5iHn2sjJtJGirY8r9PSD6yn\n\tZ4VoX1lclJ/GYllYpEGCVsRC6HAvWZ5b69hcWyohRxUbfMxK36sIXfF/iLGXePP40M\n\txUzyxPpEAXF069IApXz1anJFpt1270b05x213bRpNofwJ7lcCo6XUIkUHgneDePJaU\n\tpD6plo0ng35CrKeDzd2lRH72kLlEcHxh5rG0laLtsjW+Fk/Dein7BHGoY4s9xrmerq\n\tZ0ddhC4haCKpdvAseexrXZOcOQ+qVk3bUMMo7Z8x9tEfqQKkE94ORi/JaD9HeGg9t0\n\tlnADgt/YG9Txg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1690493510;\n\tbh=bTS8AjgbUIBi52E4EZh3KSP9RUQ2GccYQQ/dUfm0RRY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=L9cF8v5HO2q2OujjSboAp+8xh61+646ZSTRsEUgOoANVRqNvmzDuvZLdmARv1BkwB\n\tW59dBVknodgfvAdXt7V+OLriReYY/Q4jIGNaaRdgVfTZfwDSBB0iNGdLQrnDHAG9Y/\n\t2IfPD9Wt/u6+MorpDkBc0FV8npCXApQ7Grf1Li+8="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"L9cF8v5H\"; dkim-atps=neutral","Date":"Fri, 28 Jul 2023 00:32:55 +0300","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<20230727213255.GN25174@pendragon.ideasonboard.com>","References":"<20230725090316.29758-1-naush@raspberrypi.com>\n\t<169027601422.3467343.15277065655520739840@Monstersaurus>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<169027601422.3467343.15277065655520739840@Monstersaurus>","Subject":"Re: [libcamera-devel] [PATCH] libcamera: yaml: Increase the YAML\n\tparser limit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]