Greg Stein wrote:
> On Tue, Dec 9, 2008 at 10:01, Hyrum K. Wright <hyrum_at_hyrumwright.org> wrote:
>> ...
>> +++ trunk/subversion/libsvn_subr/checksum.c Tue Dec 9 10:01:12 2008 (r34627)
>> @@ -69,13 +69,13 @@ svn_checksum_create(svn_checksum_kind_t
>> }
>>
>> svn_checksum_t *
>> -svn_checksum__from_md5_digest(const unsigned char *digest,
>> - apr_pool_t *result_pool)
>> +svn_checksum__from_digest(const unsigned char *digest,
>> + svn_checksum_kind_t kind,
>> + apr_pool_t *result_pool)
>> {
>> - svn_checksum_t *checksum = svn_checksum_create(svn_checksum_md5,
>> - result_pool);
>> + svn_checksum_t *checksum = svn_checksum_create(kind, result_pool);
>>
>> - memcpy((unsigned char *)checksum->digest, digest, APR_MD5_DIGESTSIZE);
>> + checksum->digest = apr_pmemdup(result_pool, digest, DIGESTSIZE(kind));
>
> I'd suggest the original memcpy() rather than allocating more memory.
r34633.
-Hyrum
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=981927
Received on 2008-12-10 00:56:16 CET