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

Re: svn_checksum_to_cstring() core dump; trying to deference NULL

From: Karl Fogel <kfogel_at_red-bean.com>
Date: Sat, 23 Aug 2008 21:57:00 -0400

Blair Zajac <blair_at_orcaware.com> writes:
> Using r32663:
>
> $ ./checkout_tests.py -v 9
>
> #0 0x000df0de in svn_checksum_to_cstring (checksum=0x0,
> pool=0x1021a18) at subversion/libsvn_subr/checksum.c:119
> 119 switch (checksum->kind)
>
> Details below.

Got a fix for this; running 'make check', will commit when done.

[[[
Don't segfault when loading a dumpfile that does not contain checksums.

This fixes the crash reported by Blair Zajac for checkout_tests 9,
"checkout file with broken eol style".

* subversion/libsvn_repos/load.c
  (apply_textdelta, set_fulltext): Any of the checksums in struct
    node_baton can be NULL, so check before using them.
]]]

Index: subversion/libsvn_repos/load.c
===================================================================
--- subversion/libsvn_repos/load.c (revision 32670)
+++ subversion/libsvn_repos/load.c (working copy)
@@ -1268,10 +1268,12 @@
 
   return svn_fs_apply_textdelta(handler, handler_baton,
                                 rb->txn_root, nb->path,
+ nb->base_checksum ?
                                 svn_checksum_to_cstring(nb->base_checksum,
- nb->pool),
+ nb->pool) : NULL,
+ nb->result_checksum ?
                                 svn_checksum_to_cstring(nb->result_checksum,
- nb->pool),
+ nb->pool) : NULL,
                                 nb->pool);
 }
 
@@ -1285,8 +1287,9 @@
 
   return svn_fs_apply_text(stream,
                            rb->txn_root, nb->path,
+ nb->result_checksum ?
                            svn_checksum_to_cstring(nb->result_checksum,
- nb->pool),
+ nb->pool) : NULL,
                            nb->pool);
 }
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-08-24 03:57:14 CEST

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.