mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Detect OOM earlier in the geopoly extension.
dbsqlfuzz 0986e7b020e6137fc6b96331f91d15753d18e42d. FossilOrigin-Name: 7237117595a3519717a0a4b03eb427c6ec55b214e7ecd6d0f63a613adec355d4
This commit is contained in:
@ -310,6 +310,10 @@ static GeoPoly *geopolyFuncParam(
|
||||
){
|
||||
const unsigned char *a = sqlite3_value_blob(pVal);
|
||||
int nVertex;
|
||||
if( a==0 ){
|
||||
sqlite3_result_error_nomem(pCtx);
|
||||
return 0;
|
||||
}
|
||||
nVertex = (a[1]<<16) + (a[2]<<8) + a[3];
|
||||
if( (a[0]==0 || a[0]==1)
|
||||
&& (nVertex*2*sizeof(GeoCoord) + 4)==(unsigned int)nByte
|
||||
|
Reference in New Issue
Block a user