[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <IA3PR11MB8986BFC6B235096EDB0C726DE591A@IA3PR11MB8986.namprd11.prod.outlook.com>
Date: Wed, 28 Jan 2026 17:44:33 +0000
From: "Loktionov, Aleksandr" <aleksandr.loktionov@...el.com>
To: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>, Jonathan Corbet
<corbet@....net>, Linux Doc Mailing List <linux-doc@...r.kernel.org>
CC: "bpf@...r.kernel.org" <bpf@...r.kernel.org>,
"intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>, Peter Zijlstra
<peterz@...radead.org>, Randy Dunlap <rdunlap@...radead.org>, "Stephen
Rothwell" <sfr@...b.auug.org.au>
Subject: RE: [Intel-wired-lan] [PATCH v2 02/25] docs: kdoc_re: don't go past
the end of a line
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf
> Of Mauro Carvalho Chehab
> Sent: Wednesday, January 28, 2026 5:50 PM
> To: Jonathan Corbet <corbet@....net>; Linux Doc Mailing List <linux-
> doc@...r.kernel.org>
> Cc: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>;
> bpf@...r.kernel.org; intel-wired-lan@...ts.osuosl.org; linux-
> kernel@...r.kernel.org; netdev@...r.kernel.org; Peter Zijlstra
> <peterz@...radead.org>; Randy Dunlap <rdunlap@...radead.org>; Stephen
> Rothwell <sfr@...b.auug.org.au>
> Subject: [Intel-wired-lan] [PATCH v2 02/25] docs: kdoc_re: don't go
> past the end of a line
>
> The logic which checks if the line ends with ";" is currently
> broken: it may try to read past the buffer.
>
> Fix it by checking before trying to access line[pos].
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
> Acked-by: Randy Dunlap <rdunlap@...radead.org>
> Tested-by: Randy Dunlap <rdunlap@...radead.org>
> ---
> tools/lib/python/kdoc/kdoc_re.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/lib/python/kdoc/kdoc_re.py
> b/tools/lib/python/kdoc/kdoc_re.py
> index 19e777e2c97e..a0402c065d3a 100644
> --- a/tools/lib/python/kdoc/kdoc_re.py
> +++ b/tools/lib/python/kdoc/kdoc_re.py
> @@ -265,7 +265,7 @@ class NestedMatch:
> out += new_sub
>
> # Drop end ';' if any
> - if line[pos] == ';':
> + if pos < len(line) and line[pos] == ';':
> pos += 1
>
> cur_pos = pos
> --
> 2.52.0
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@...el.com>
Powered by blists - more mailing lists