The CCI_QUERY_RESULT_RESULT macro gets the result count of the cci_execute_batch query. It does not check whether the specified argument, query_result, is NULL and whether index is valid.
#define CCI_QUERY_RESULT_RESULT(T_CCI_QUERY_RESULT* query_result, int index)