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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to