mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Oleksij Rempel <linux@rempel-privat.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v1 1/5] commands: keystore: init s_len
Date: Mon, 12 Nov 2018 08:34:49 +0100	[thread overview]
Message-ID: <20181112073449.e7qii7guvm4lsnte@pengutronix.de> (raw)
In-Reply-To: <20181110075954.32746-2-linux@rempel-privat.de>

On Sat, Nov 10, 2018 at 08:59:50AM +0100, Oleksij Rempel wrote:
> if read_file_2 will fail, s_len will stay uninitialized.
> 
> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
> ---
>  commands/keystore.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/commands/keystore.c b/commands/keystore.c
> index 52c4be263..50a6c8494 100644
> --- a/commands/keystore.c
> +++ b/commands/keystore.c
> @@ -15,7 +15,7 @@ static int do_keystore(int argc, char *argv[])
>  	const char *file = NULL;
>  	char *secret_str = NULL;
>  	void *secret;
> -	int s_len;
> +	int s_len = 0;

if read_file_2 fails then s_len is also not used.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2018-11-12  7:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-10  7:59 [PATCH v1 0/5] random fixes Oleksij Rempel
2018-11-10  7:59 ` [PATCH v1 1/5] commands: keystore: init s_len Oleksij Rempel
2018-11-12  7:34   ` Sascha Hauer [this message]
2018-11-10  7:59 ` [PATCH v1 2/5] ddr_spd: remove unused array Oleksij Rempel
2018-11-10  7:59 ` [PATCH v1 3/5] video/ssd1307fb: fix potential memory leak on error Oleksij Rempel
2018-11-16  7:52   ` Sascha Hauer
2018-11-10  7:59 ` [PATCH v1 4/5] clk: imx: cpu: avoid use after free " Oleksij Rempel
2018-11-12  7:36   ` Sascha Hauer
2018-11-10  7:59 ` [PATCH v1 5/5] of: partition: set ret for error cases Oleksij Rempel

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=20181112073449.e7qii7guvm4lsnte@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=linux@rempel-privat.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox