From: Peter Huewe <peterhuewe@gmx.de>
To: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: "moderated list:TPM DEVICE DRIVER"
<tpmdd-devel@lists.sourceforge.net>,
safford@us.ibm.com, open list <linux-kernel@vger.kernel.org>
Subject: Re: [tpmdd-devel] [PATCH v2] tpm: introduce struct tpm_buf
Date: Tue, 09 Jun 2015 12:32:57 +0200 [thread overview]
Message-ID: <1C403FBE-76FF-425C-8627-5956838CD560@gmx.de> (raw)
In-Reply-To: <20150609091932.GC4968@jsakkine-mobl1>
Hi
>> > +static inline void tpm_buf_store(struct tpm_buf *buf,
>> > + unsigned int pos,
>> > + const unsigned char *data,
>> > + unsigned int len)
>> > +{
>> > + BUG_ON((pos + len) > TPM_BUF_SIZE);
>> > +
>> > + memcpy(&buf->data[pos], data, len);
>> > +}
>>
>> Don't you have to update the ->length here?
>
>No. Store is for placing value in position, not appending to the end.
>
Then either add a length check (whether ->length is big enough) and/or call the function "update"
Peter
next prev parent reply other threads:[~2015-06-09 10:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-03 16:39 [PATCH v2] tpm: introduce struct tpm_buf Jarkko Sakkinen
2015-06-08 20:39 ` Peter Hüwe
2015-06-09 9:19 ` Jarkko Sakkinen
2015-06-09 10:32 ` Peter Huewe [this message]
2015-06-09 11:39 ` [tpmdd-devel] " Jarkko Sakkinen
2015-06-09 11:58 ` Peter Huewe
2015-06-09 12:05 ` Jarkko Sakkinen
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=1C403FBE-76FF-425C-8627-5956838CD560@gmx.de \
--to=peterhuewe@gmx.de \
--cc=jarkko.sakkinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=safford@us.ibm.com \
--cc=tpmdd-devel@lists.sourceforge.net \
/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;
as well as URLs for NNTP newsgroup(s).