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

Set the database connection error code for an oversize argument to

sqlite3_bind_blob64() or sqlite3_bind_text64().
[forum:/info/a636276f0d451667|Forum post a636276f0d451667] and
[forum/forumpost/33821c8db543c|33821c8db543c].

FossilOrigin-Name: 56ff58c0b8905aa10c85f1418da8d6089d23fd9a220c5cb17027d46affe05002
This commit is contained in:
drh
2021-06-09 14:45:02 +00:00
parent 8d2a9c3b3a
commit d622855e34
5 changed files with 22 additions and 30 deletions

View File

@@ -392,7 +392,7 @@ static int invokeValueDestructor(
}else{
xDel((void*)p);
}
if( pCtx ) sqlite3_result_error_toobig(pCtx);
sqlite3_result_error_toobig(pCtx);
return SQLITE_TOOBIG;
}
void sqlite3_result_blob(
@@ -1374,7 +1374,7 @@ static int bindText(
sqlite3_stmt *pStmt, /* The statement to bind against */
int i, /* Index of the parameter to bind */
const void *zData, /* Pointer to the data to be bound */
int nData, /* Number of bytes of data to be bound */
i64 nData, /* Number of bytes of data to be bound */
void (*xDel)(void*), /* Destructor for the data */
u8 encoding /* Encoding for the data */
){
@@ -1426,11 +1426,7 @@ int sqlite3_bind_blob64(
void (*xDel)(void*)
){
assert( xDel!=SQLITE_DYNAMIC );
if( nData>0x7fffffff ){
return invokeValueDestructor(zData, xDel, 0);
}else{
return bindText(pStmt, i, zData, (int)nData, xDel, 0);
}
return bindText(pStmt, i, zData, nData, xDel, 0);
}
int sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
int rc;
@@ -1500,12 +1496,8 @@ int sqlite3_bind_text64(
unsigned char enc
){
assert( xDel!=SQLITE_DYNAMIC );
if( nData>0x7fffffff ){
return invokeValueDestructor(zData, xDel, 0);
}else{
if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
return bindText(pStmt, i, zData, (int)nData, xDel, enc);
}
if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
return bindText(pStmt, i, zData, nData, xDel, enc);
}
#ifndef SQLITE_OMIT_UTF16
int sqlite3_bind_text16(