subversion/subversion-1.12.2-fsfspacktest.patch
Joe Orton 0e0c958468 fix FTBFS on 32-bit arches (#1800120)
Resolves: rhbz#1800120
2020-02-12 12:48:53 +00:00

27 lines
1004 B
Diff

get_rev_contents() has signed integer overflow with "long int" rev
and behaves unpredictably.
--- subversion-1.12.2/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c.fsfspacktest
+++ subversion-1.12.2/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c
@@ -59,7 +59,8 @@
get_rev_contents(svn_revnum_t rev, apr_pool_t *pool)
{
/* Toss in a bunch of magic numbers for spice. */
- apr_int64_t num = ((rev * 1234353 + 4358) * 4583 + ((rev % 4) << 1)) / 42;
+ apr_int64_t rev64 = rev;
+ apr_int64_t num = ((rev64 * 1234353 + 4358) * 4583 + ((rev64 % 4) << 1)) / 42;
return apr_psprintf(pool, "%" APR_INT64_T_FMT "\n", num);
}
@@ -407,7 +408,8 @@
if (! svn_stringbuf_compare(rstring, sb))
return svn_error_createf(SVN_ERR_FS_GENERAL, NULL,
- "Bad data in revision %ld.", i);
+ "Bad data in revision %ld - [%s] not [%s].",
+ i, rstring->data, sb->data);
}
return SVN_NO_ERROR;