1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Improve the sqlite3_result_pointer() interface so that it cannot be faked

using sqlite3_result_null() and sqlite3_result_subtype().

FossilOrigin-Name: c13264d5ef0470fb24e09f7bc12f19be3b77eab06d41f55607b38dddb532a132
This commit is contained in:
drh
2017-07-17 11:39:46 +00:00
parent ae3ec3f920
commit 9a541c0361
4 changed files with 10 additions and 13 deletions

View File

@@ -201,7 +201,7 @@ unsigned int sqlite3_value_subtype(sqlite3_value *pVal){
}
void *sqlite3_value_pointer(sqlite3_value *pVal, const char *zPType){
Mem *p = (Mem*)pVal;
if( (p->flags & MEM_TypeMask)==(MEM_Null|MEM_Subtype)
if( p->flags==(MEM_Null|MEM_Subtype|MEM_Term|MEM_Static)
&& p->eSubtype=='p'
&& zPType!=0
&& strcmp(p->z, zPType)==0