diff --git a/OdbcDesc.cpp b/OdbcDesc.cpp index fcd51e1f..2f264a0d 100644 --- a/OdbcDesc.cpp +++ b/OdbcDesc.cpp @@ -210,7 +210,8 @@ SQLRETURN OdbcDesc::operator =(OdbcDesc &sour) for ( int n = 0 ; n <= headCount ; n++ ) { - DescRecord *srcrec = sour.records[n]; + // sour.records is NULL for an empty source — guard like the other loops in this file. + DescRecord *srcrec = sour.records ? sour.records[n] : NULL; DescRecord &rec = *getDescRecord ( n ); if ( srcrec ) diff --git a/tests/test_phase7_crusher_fixes.cpp b/tests/test_phase7_crusher_fixes.cpp index 2306141e..4ef5151f 100644 --- a/tests/test_phase7_crusher_fixes.cpp +++ b/tests/test_phase7_crusher_fixes.cpp @@ -12,7 +12,6 @@ class CopyDescCrashTest : public OdbcConnectedTest {}; TEST_F(CopyDescCrashTest, CopyEmptyARDDoesNotCrash) { - GTEST_SKIP() << "Requires Phase 7: ODBC Crusher-identified bug fixes (not yet merged)"; // Allocate two statements with no bindings (empty ARDs) SQLHSTMT stmt1 = AllocExtraStmt(); SQLHSTMT stmt2 = AllocExtraStmt(); @@ -49,7 +48,6 @@ TEST_F(CopyDescCrashTest, CopyEmptyARDDoesNotCrash) { } TEST_F(CopyDescCrashTest, CopyEmptyToExplicitDescriptor) { - GTEST_SKIP() << "Requires Phase 7: ODBC Crusher-identified bug fixes (not yet merged)"; // Allocate an explicit descriptor SQLHDESC hExplicit = SQL_NULL_HDESC; SQLRETURN ret = SQLAllocHandle(SQL_HANDLE_DESC, hDbc, &hExplicit); @@ -70,7 +68,6 @@ TEST_F(CopyDescCrashTest, CopyEmptyToExplicitDescriptor) { } TEST_F(CopyDescCrashTest, CopyPopulatedThenEmpty) { - GTEST_SKIP() << "Requires Phase 7: ODBC Crusher-identified bug fixes (not yet merged)"; // First, populate an explicit descriptor by copying a populated ARD SQLINTEGER val = 0; SQLLEN ind = 0;