From: Frank Rowand <frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Maninder Singh
<maninder1.s-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
v.narang-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
pankaj.m-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
ajeet.y-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org
Subject: Re: [PATCH 1/1] scripts: Fixing NULL pointer dereference when pos->file is NULL
Date: Tue, 29 Nov 2016 11:08:55 -0800 [thread overview]
Message-ID: <583DD247.3000506@gmail.com> (raw)
In-Reply-To: <1480415699-35335-1-git-send-email-maninder1.s-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
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-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> Signed-off-by: Vaneet Narang <v.narang-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> ---
> 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
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Frank Rowand <frowand.list@gmail.com>
To: Maninder Singh <maninder1.s@samsung.com>,
robh+dt@kernel.org, frowand.list@gmail.com
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
v.narang@samsung.com, pankaj.m@samsung.com, ajeet.y@samsung.com
Subject: Re: [PATCH 1/1] scripts: Fixing NULL pointer dereference when pos->file is NULL
Date: Tue, 29 Nov 2016 11:08:55 -0800 [thread overview]
Message-ID: <583DD247.3000506@gmail.com> (raw)
In-Reply-To: <1480415699-35335-1-git-send-email-maninder1.s@samsung.com>
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@samsung.com>
> Signed-off-by: Vaneet Narang <v.narang@samsung.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
next prev parent reply other threads:[~2016-11-29 19:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-29 10:34 [PATCH 1/1] scripts: Fixing NULL pointer dereference when pos->file is NULL Maninder Singh
2016-11-29 10:34 ` Maninder Singh
[not found] ` <1480415699-35335-1-git-send-email-maninder1.s-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-29 11:15 ` Arnd Bergmann
2016-11-29 11:15 ` Arnd Bergmann
2016-11-29 19:08 ` Frank Rowand [this message]
2016-11-29 19:08 ` Frank Rowand
[not found] ` <CGME20161129190906epcas4p153a72fd483fffc054e2a4644ef30b0ee@epcas4p1.samsung.com>
2016-11-30 3:48 ` Maninder Singh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=583DD247.3000506@gmail.com \
--to=frowand.list-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=ajeet.y-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=maninder1.s-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=pankaj.m-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=v.narang-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.