[unixODBC-dev] Add the NULL pointer check in some functions

xiaonan xn212516 at 163.com
Wed Nov 19 08:41:02 GMT 2014


Hi Nick,


At the beginning of the __validate_stmt(), the function will check whether the statement is NULL or not:
int __validate_stmt( DMHSTMT statement )
{
#ifdef FAST_HANDLE_VALIDATE


if ( statement && *(( int * ) statement ) == HSTMT_MAGIC )
return 1;
else
return 0;


#else
......
#endif
}
So I think __validate_env(), __validate_dbc() and __validate_desc() should all add this protection. E.g.:
int __validate_env( DMHENV env )
{
#ifdef FAST_HANDLE_VALIDATE


if ( env && *(( int * ) env ) == HENV_MAGIC )
return 1;
else
return 0;
#else
......
#endif
}


Best Regards
Nan Xiao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-dev/attachments/20141119/63318e90/attachment.html>


More information about the unixODBC-dev mailing list