mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Ensure that geopoly does not invoke sqlite3_result_error_nomem() with a
NULL pointer. FossilOrigin-Name: 2483310d15022b47109b44c86e100f5894be7a45a0568dfef6aea80e6c518654
This commit is contained in:
@ -305,13 +305,14 @@ static GeoPoly *geopolyFuncParam(
|
||||
){
|
||||
GeoPoly *p = 0;
|
||||
int nByte;
|
||||
testcase( pCtx==0 );
|
||||
if( sqlite3_value_type(pVal)==SQLITE_BLOB
|
||||
&& (nByte = sqlite3_value_bytes(pVal))>=(4+6*sizeof(GeoCoord))
|
||||
){
|
||||
const unsigned char *a = sqlite3_value_blob(pVal);
|
||||
int nVertex;
|
||||
if( a==0 ){
|
||||
sqlite3_result_error_nomem(pCtx);
|
||||
if( pCtx ) sqlite3_result_error_nomem(pCtx);
|
||||
return 0;
|
||||
}
|
||||
nVertex = (a[1]<<16) + (a[2]<<8) + a[3];
|
||||
|
Reference in New Issue
Block a user