From ab8f65fb586af52d647de0f59b51c2fd6b4439a9 Mon Sep 17 00:00:00 2001 From: g00525463 Date: Mon, 28 Jun 2021 11:42:30 +0800 Subject: [PATCH 2/2] [Huawei]add null-dereference check in SQLRowCount Offering: GaussDB Kernel More detail: check null cases to avoid crash --- DriverManager/SQLRowCount.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/DriverManager/SQLRowCount.c b/DriverManager/SQLRowCount.c index fa53158..fcee5a9 100644 --- a/DriverManager/SQLRowCount.c +++ b/DriverManager/SQLRowCount.c @@ -139,6 +139,9 @@ SQLRETURN SQLRowCount( SQLHSTMT statement_handle, SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; + if (!rowcount) { + return SQL_ERROR; + } /* * check statement */ -- 2.23.0