Re: [PATCH] Limit the size of the data block passed to SHA1_Update()
- From
Atousa Duprat <atousa.p@gmail.com>
- Date
- Nov 1, 2015, 06:41 UTC
- Message-ID
- <CA+izobuGFGhho9X6xGdXMskay3UH6-FuzriNA7=mkveFjo0SBA@mail.gmail.com>
- In-Reply-To
- <xmqqa8r0j8tu.fsf@gitster.mtv.corp.google.com>
Show 5 quoted lines
>> +int git_SHA1_Update(SHA_CTX *c, const void *data, size_t len)
>> +{
>> + size_t nr;
>> + size_t total = 0;
>> + char *cdata = (char*)data;Show 5 quoted lines
> I am not sure about the cast > here, though. Doesn't the function SHA1_Update() you are going to > call in the body of the loop take "const void *" as its second > parameter? That's how openssl/sha1.h and block-sha1/sha1.h declare > this function.
Indeed, the declaration needs a const void *; but I need to advance by a specific number of bytes in each iteration of the loop. Hence the cast.
Atousa