@@ -95,6 +95,9 @@ int init()
95
95
96
96
inline void setIndicatorPtr (SQLLEN* ptr, SQLLEN value, DescRecord* rec)
97
97
{
98
+ if (!ptr)
99
+ return ;
100
+
98
101
if (rec->isIndicatorSqlDa )
99
102
{
100
103
*(short *)ptr = (short )value;
@@ -1018,25 +1021,25 @@ ADRESS_FUNCTION OdbcConvert::getAdressFunction(DescRecord * from, DescRecord * t
1018
1021
inline
1019
1022
SQLPOINTER OdbcConvert::getAdressBindDataFrom (char * pointer)
1020
1023
{
1021
- return (SQLPOINTER)(pointer + *bindOffsetPtrFrom);
1024
+ return pointer ? (SQLPOINTER)(pointer + *bindOffsetPtrFrom) : NULL ;
1022
1025
}
1023
1026
1024
1027
inline
1025
1028
SQLLEN * OdbcConvert::getAdressBindIndFrom (char * pointer)
1026
1029
{
1027
- return (SQLLEN *)(pointer + *bindOffsetPtrIndFrom);
1030
+ return pointer ? (SQLLEN *)(pointer + *bindOffsetPtrIndFrom) : NULL ;
1028
1031
}
1029
1032
1030
1033
inline
1031
1034
SQLPOINTER OdbcConvert::getAdressBindDataTo (char * pointer)
1032
1035
{
1033
- return (SQLPOINTER)(pointer + *bindOffsetPtrTo);
1036
+ return pointer ? (SQLPOINTER)(pointer + *bindOffsetPtrTo) : NULL ;
1034
1037
}
1035
1038
1036
1039
inline
1037
1040
SQLLEN * OdbcConvert::getAdressBindIndTo (char * pointer)
1038
1041
{
1039
- return (SQLLEN *)(pointer + *bindOffsetPtrIndTo);
1042
+ return pointer ? (SQLLEN *)(pointer + *bindOffsetPtrIndTo) : NULL ;
1040
1043
}
1041
1044
1042
1045
#define ODBCCONVERT_CHECKNULL (pointerTo ) \
@@ -1081,10 +1084,11 @@ SQLLEN * OdbcConvert::getAdressBindIndTo(char * pointer)
1081
1084
{ \
1082
1085
if ( checkIndicatorPtr ( indicatorFrom, SQL_NULL_DATA, from ) ) \
1083
1086
{ \
1084
- setIndicatorPtr ( indicatorTo, SQL_NULL_DATA, to ); \
1087
+ if ( indicatorTo ) \
1088
+ setIndicatorPtr ( indicatorTo, SQL_NULL_DATA, to ); \
1085
1089
return SQL_SUCCESS; \
1086
1090
} \
1087
- else \
1091
+ else if ( indicatorTo ) \
1088
1092
setIndicatorPtr ( indicatorTo, 0 , to ); \
1089
1093
} \
1090
1094
if ( !pointer ) \
@@ -1093,10 +1097,11 @@ SQLLEN * OdbcConvert::getAdressBindIndTo(char * pointer)
1093
1097
#define ODBCCONVERT_CHECKNULL_SQLDA \
1094
1098
if ( checkIndicatorPtr( indicatorFrom, SQL_NULL_DATA, from ) ) \
1095
1099
{ \
1096
- setIndicatorPtr ( indicatorTo, SQL_NULL_DATA, to ); \
1100
+ if ( indicatorTo ) \
1101
+ setIndicatorPtr ( indicatorTo, SQL_NULL_DATA, to ); \
1097
1102
return SQL_SUCCESS; \
1098
1103
} \
1099
- else \
1104
+ else if ( indicatorTo ) \
1100
1105
setIndicatorPtr ( indicatorTo, 0 , to ); \
1101
1106
1102
1107
#define GET_LEN_FROM_OCTETLENGTHPTR \
0 commit comments