[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <583DD247.3000506@gmail.com>
Date: Tue, 29 Nov 2016 11:08:55 -0800
From: Frank Rowand <frowand.list@...il.com>
To: Maninder Singh <maninder1.s@...sung.com>, robh+dt@...nel.org,
frowand.list@...il.com
Cc: devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
v.narang@...sung.com, pankaj.m@...sung.com, ajeet.y@...sung.com
Subject: Re: [PATCH 1/1] scripts: Fixing NULL pointer dereference when
pos->file is NULL
On 11/29/16 02:34, Maninder Singh wrote:
> This patch fixes NULL pointer dereference when pos->file is NULL.
>
> caught with static analysis tool.
> Signed-off-by: Maninder Singh <maninder1.s@...sung.com>
> Signed-off-by: Vaneet Narang <v.narang@...sung.com>
> ---
> scripts/dtc/srcpos.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/scripts/dtc/srcpos.c b/scripts/dtc/srcpos.c
> index f534c22..360fd14 100644
> --- a/scripts/dtc/srcpos.c
> +++ b/scripts/dtc/srcpos.c
> @@ -252,12 +252,11 @@ struct srcpos *
> srcpos_dump(struct srcpos *pos)
> {
> printf("file : \"%s\"\n",
> - pos->file ? (char *) pos->file : "<no file>");
> + pos->file ? pos->file->name : "<no file>");
> printf("first_line : %d\n", pos->first_line);
> printf("first_column: %d\n", pos->first_column);
> printf("last_line : %d\n", pos->last_line);
> printf("last_column : %d\n", pos->last_column);
> - printf("file : %s\n", pos->file->name);
> }
>
>
>
Hi Maninder,
Please send any patches for dtc to the devicetree-compiler
mail list. For details, see:
http://vger.kernel.org/vger-lists.html#devicetree-compiler
-Frank
Powered by blists - more mailing lists