From: Martin Peres <martin.peres-GANU6spQydw@public.gmane.org>
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH envytools] nvbios: Add missing null byte to string read from file.
Date: Sun, 31 Aug 2014 15:16:15 +0200 [thread overview]
Message-ID: <5403201F.7030609@free.fr> (raw)
In-Reply-To: <1409490042-8725-1-git-send-email-titan.costa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On 31/08/2014 15:00, Christian Costa wrote:
> ---
> nvbios/nvbios.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/nvbios/nvbios.c b/nvbios/nvbios.c
> index f7aafe3..28e62ad 100644
> --- a/nvbios/nvbios.c
> +++ b/nvbios/nvbios.c
> @@ -774,11 +774,12 @@ int set_strap_from_string(const char* strap_s)
> int set_strap_from_file(const char *path)
> {
> FILE *strapfile = NULL;
> - char tmp[21];
> + char tmp[22];
>
> strapfile = fopen(path, "r");
> if (strapfile) {
> - fread(tmp, 1, 21, strapfile);
> + size_t size = fread(tmp, 1, 21, strapfile);
> + tmp[size] = 0;
> return set_strap_from_string(tmp);
> }
>
Thanks, I pushed the first 3 patches!
prev parent reply other threads:[~2014-08-31 13:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-31 13:00 [PATCH envytools] nvbios: Add missing null byte to string read from file Christian Costa
[not found] ` <1409490042-8725-1-git-send-email-titan.costa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-08-31 13:00 ` [PATCH envytools] nva: Add nvaforcetemp to git ignore and sort it for better update Christian Costa
[not found] ` <1409490042-8725-2-git-send-email-titan.costa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-08-31 13:13 ` Martin Peres
2014-08-31 13:00 ` [PATCH envytools] nvamemtiming: Update usage Christian Costa
2014-08-31 13:00 ` [PATCH envytools] nvamemtiming: Handle target < initial case when iterating values Christian Costa
[not found] ` <1409490042-8725-4-git-send-email-titan.costa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-08-31 13:12 ` Martin Peres
[not found] ` <54031F56.4070906-GANU6spQydw@public.gmane.org>
2014-08-31 14:01 ` Christian Costa
[not found] ` <54032AB3.3000508-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-08-31 14:11 ` Martin Peres
[not found] ` <54032D11.1000601-GANU6spQydw@public.gmane.org>
2014-08-31 14:19 ` Christian Costa
[not found] ` <54032F00.6000500-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-08-31 14:23 ` Martin Peres
[not found] ` <54032FE2.7020602-GANU6spQydw@public.gmane.org>
2014-08-31 15:18 ` Christian Costa
[not found] ` <54033CAC.7020001-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-08-31 15:20 ` Christian Costa
[not found] ` <54033D47.40902-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-08-31 15:38 ` Martin Peres
2014-08-31 13:16 ` Martin Peres [this message]
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=5403201F.7030609@free.fr \
--to=martin.peres-ganu6spqydw@public.gmane.org \
--cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@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.