Skip to content

Commit 3018d2d

Browse files
committed
Fix array overrun in fdb_functional test
As identified during testing for AArch64 support, fdb_functional_test attempts to access array element 13 in a 10 element array, which is flaggedy by UBSan: 10: i=13 10: ../forestdb/tests/functional/fdb_functional_test.cc:257:21: runtime error: load of address 0xfffff1796fa8 with insufficient space for an object of type 'struct fdb_doc *' 10: 0xfffff1796fa8: note: pointer points here 10: ff ff 00 00 00 92 51 00 00 00 00 00 d0 6f 79 f1 ff ff 00 00 6c 24 52 00 00 00 00 00 b0 76 79 f1 10: ^ Change-Id: I37545e8a13fc745029427f68ed46347db51fa587 Reviewed-on: http://review.couchbase.org/c/forestdb/+/159303 Reviewed-by: Paolo Cocchi <[email protected]> Tested-by: Build Bot <[email protected]>
1 parent f872bd4 commit 3018d2d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/functional/fdb_functional_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ void basic_test()
253253
(void *) "basic_test");
254254
TEST_CHK(status == FDB_RESULT_SUCCESS);
255255

256-
status = fdb_set(db_rdonly, doc[i]);
256+
status = fdb_set(db_rdonly, doc[0]);
257257
TEST_CHK(status == FDB_RESULT_RONLY_VIOLATION);
258258
TEST_CHK(!strcmp(fdb_error_msg(status), "database is read-only"));
259259

0 commit comments

Comments
 (0)