[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

a bug in svn_fs_base__unparse_representation_skel?

From: Mary Jane Lemur <mjlemur_at_gmail.com>
Date: 2005-12-08 23:23:19 CET

i'm looking in libsvn_fs_base/util/fs_skels.c, line 1038.

the code seems to be duplicating the rep->checksum array in memory by
calling svn_fs_base__mem_atom. i understand that it's passing
rep->checksum as the 'data' argument, but for the 'length' argument
its passing

APR_MD5_DIGESTSIZE / sizeof (*(rep->checksum)

isnt this wrong? if we're on a system where (unsigned char) is 2
bytes, then dont we want to allocate a memory space thats twice as
big? instead of dividing, shouldnt it be multiplying by the sizeof()?
 like

APR_MD5_DIGESTSIZE * sizeof (*(rep->checksum)

i'm guessing that this bug hasnt been noticed because every system so
far has a 1-byte unsigned char, so we're dividing APR_MD5_DIGESTSIZE
by 1, which works out ok. just lucky, mebbe?

--mj

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Dec 8 23:24:33 2005

This is an archived mail posted to the Subversion Dev mailing list.