You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "cdaudt (via GitHub)" <gi...@apache.org> on 2023/04/19 05:55:35 UTC

[GitHub] [arrow-adbc] cdaudt commented on a diff in pull request #570: fix(c/driver_manager): protect against uninitialized AdbcError

cdaudt commented on code in PR #570:
URL: https://github.com/apache/arrow-adbc/pull/570#discussion_r1170838937


##########
c/driver_manager/adbc_driver_manager_test.cc:
##########
@@ -86,6 +86,47 @@ TEST_F(DriverManager, DatabaseCustomInitFunc) {
   ASSERT_THAT(AdbcDatabaseRelease(&database, &error), IsOkStatus(&error));
 }
 
+TEST_F(DriverManager, UninitializedError) {
+  struct AdbcDatabase database;
+  struct AdbcError invalid_err;
+  std::memset(&database, 0, sizeof(database));
+
+  // Force junk into AdbcError going into calls to
+  // simulate API calls using uninitialized AdbcError structs
+  std::memset(&invalid_err, 0xff, sizeof(invalid_err));
+  ASSERT_THAT(AdbcDatabaseInit(&database, &invalid_err),
+              IsStatus(ADBC_STATUS_INVALID_STATE, &invalid_err));

Review Comment:
   Yes, there are a few missing releases (in my patch and other tests). Updating the patchset to add these. 
   
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org