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

Re: [PATCH]svn_fs_base__txn_proplist_in_trail never sets a null txnproplist(leverage on this fact).

From: Madan U Sreenivasan <madan_at_collab.net>
Date: 2006-10-06 10:58:33 CEST

On Fri, 06 Oct 2006 01:06:16 +0530, Kamesh Jayachandran
<kamesh@collab.net> wrote:

> Index: subversion/libsvn_fs_base/dag.c
> ===================================================================
> --- subversion/libsvn_fs_base/dag.c(revision 21673)
> +++ subversion/libsvn_fs_base/dag.c(working copy)
> @@ -1428,18 +1428,13 @@
> /* Remove any temporary transaction properties initially created by
> begin_txn(). */
> SVN_ERR(svn_fs_base__txn_proplist_in_trail(&txnprops, txn_id, trail));
> - if (txnprops)
> - {
> - if (apr_hash_get(txnprops, SVN_FS_PROP_TXN_CHECK_OOD,
> - APR_HASH_KEY_STRING))
> - SVN_ERR(svn_fs_base__set_txn_prop
> - (fs, txn_id, SVN_FS_PROP_TXN_CHECK_OOD, NULL, trail,
> pool));
> + if (apr_hash_get(txnprops, SVN_FS_PROP_TXN_CHECK_OOD,
> APR_HASH_KEY_STRING))
> + SVN_ERR(svn_fs_base__set_txn_prop
> + (fs, txn_id, SVN_FS_PROP_TXN_CHECK_OOD, NULL, trail, pool));
> - if (apr_hash_get(txnprops, SVN_FS_PROP_TXN_CHECK_LOCKS,
> - APR_HASH_KEY_STRING))
> - SVN_ERR(svn_fs_base__set_txn_prop
> - (fs, txn_id, SVN_FS_PROP_TXN_CHECK_LOCKS, NULL, trail,
> pool));
> - }

Is there any specific reason you have removed the check for non-NULL of
txnprops? iirc, apr_hash_get() could crash if txnprops is NULL.

-- 
Regards,
Madan U S
www.symonds.net/~madan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Oct 6 05:28:59 2006

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.