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

RE: svn commit: r995475 - /subversion/trunk/subversion/libsvn_repos/load.c

From: Bert Huijben <bert_at_vmoo.com>
Date: Thu, 9 Sep 2010 20:58:10 +0200

> -----Original Message-----
> From: stsp_at_apache.org [mailto:stsp_at_apache.org]
> Sent: donderdag 9 september 2010 17:52
> To: commits_at_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
Received on 2010-09-09 20:59:45 CEST

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