You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by li...@apache.org on 2023/05/04 15:48:32 UTC

[arrow-adbc] branch main updated: fix(c/validation): correct indexing in TestMetadataGetObjectsTables (#649)

This is an automated email from the ASF dual-hosted git repository.

lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git


The following commit(s) were added to refs/heads/main by this push:
     new 7f15131  fix(c/validation): correct indexing in TestMetadataGetObjectsTables (#649)
7f15131 is described below

commit 7f15131f5e4a3e315ca3c69624f51a5a8f174609
Author: David Li <li...@gmail.com>
AuthorDate: Thu May 4 11:48:27 2023 -0400

    fix(c/validation): correct indexing in TestMetadataGetObjectsTables (#649)
    
    A nested list was being indexed incorrectly, causing an out-of-bounds
    read. This didn't trigger before because no driver returned more than
    one row in the first place.
    
    Fixes #647.
---
 c/validation/adbc_validation.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/c/validation/adbc_validation.cc b/c/validation/adbc_validation.cc
index 886ed48..9fa0e8f 100644
--- a/c/validation/adbc_validation.cc
+++ b/c/validation/adbc_validation.cc
@@ -607,8 +607,8 @@ void ConnectionTest::TestMetadataGetObjectsTables() {
           ASSERT_FALSE(ArrowArrayViewIsNull(db_schema_tables_list, db_schemas_index))
               << "Row " << row << " should have non-null db_schema_tables";
 
-          for (int64_t tables_index = ArrowArrayViewGetOffsetUnsafe(
-                   db_schema_tables_list, row + db_schemas_index);
+          for (int64_t tables_index =
+                   ArrowArrayViewGetOffsetUnsafe(db_schema_tables_list, db_schemas_index);
                tables_index <
                ArrowArrayViewGetOffsetUnsafe(db_schema_tables_list, db_schemas_index + 1);
                tables_index++) {