Skip to content

Commit 70b3618

Browse files
committed
Handle revisions with no revprops
Sometimes some revisions are filtered out by authz rules on the server, and when you create a mirror with svnsync, you end up with an empty revision that has no revprops whatsoever. This means svnlog, svndate and svnauthor are all NULL. This used to cause segfaults. Here's some context: http://svn.haxx.se/users/archive-2013-02/0160.shtml
1 parent b5c3d3a commit 70b3618

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/svn.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,9 +523,9 @@ int SvnRevision::fetchRevProps()
523523
svn_string_t *svndate = (svn_string_t*)apr_hash_get(revprops, "svn:date", APR_HASH_KEY_STRING);
524524
svn_string_t *svnlog = (svn_string_t*)apr_hash_get(revprops, "svn:log", APR_HASH_KEY_STRING);
525525

526-
log = svnlog->data;
526+
log = svnlog ? svnlog->data : 0;
527527
authorident = svnauthor ? identities.value(svnauthor->data) : QByteArray();
528-
epoch = get_epoch(svndate->data);
528+
epoch = svndate ? get_epoch(svndate->data) : 0;
529529
if (authorident.isEmpty()) {
530530
if (!svnauthor || svn_string_isempty(svnauthor))
531531
authorident = "nobody <nobody@localhost>";

0 commit comments

Comments
 (0)