> -----Original Message-----
> From: s...@apache.org [mailto:s...@apache.org]
> Sent: donderdag 9 september 2010 17:52
> To: comm...@subversion.apache.org
> Subject: svn commit: r995475 -
> /subversion/trunk/subversion/libsvn_repos/load.c
> 
> Author: stsp
> Date: Thu Sep  9 15:51:34 2010
> New Revision: 995475
> 
> URL: http://svn.apache.org/viewvc?rev=995475&view=rev
> Log:
> * subversion/libsvn_repos/load.c
>   (parse_property_block): Use svn_cstring_atoi64() instead of atoi()
> (switching
>    to 64bit because size_t isn't guaranteed to be 32bit).
> 
> Modified:
>     subversion/trunk/subversion/libsvn_repos/load.c
> 
> Modified: subversion/trunk/subversion/libsvn_repos/load.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/lo
> ad.c?rev=995475&r1=995474&r2=995475&view=diff
> ==========================================================
> ====================
> --- subversion/trunk/subversion/libsvn_repos/load.c (original)
> +++ subversion/trunk/subversion/libsvn_repos/load.c Thu Sep  9 15:51:34
> 2010
> @@ -524,9 +524,11 @@ parse_property_block(svn_stream_t *strea
>        else if ((buf[0] == 'D') && (buf[1] == ' '))
>          {
>            char *keybuf;
> +          apr_int64_t len;
> 
> +          SVN_ERR(svn_cstring_atoi64(&len, buf + 2));
>            SVN_ERR(read_key_or_val(&keybuf, actual_length,
> -                                  stream, atoi(buf + 2), proppool));
> +                                  stream, (apr_size_t)len, proppool));

What would this do if you have 4GB + 1 byte?

I expected that we would use the new svn_cstring conversion variants to check 
for that kind of errors (for overflows, etc.), but now we just ignore the error 
at a different level.

        Bert 


Reply via email to