1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Fix an issue with sha3_query() when the first argument contains blank

SQL statements.

FossilOrigin-Name: 24baab9a9faab50c26d7167821031cd66aaf784baefbc0f92354ae54ac43a714
This commit is contained in:
drh
2021-01-08 19:53:18 +00:00
parent 3a5e975947
commit 1242c0ccf4
3 changed files with 13 additions and 11 deletions

View File

@ -624,9 +624,11 @@ static void sha3QueryFunc(
}
nCol = sqlite3_column_count(pStmt);
z = sqlite3_sql(pStmt);
n = (int)strlen(z);
hash_step_vformat(&cx,"S%d:",n);
SHA3Update(&cx,(unsigned char*)z,n);
if( z ){
n = (int)strlen(z);
hash_step_vformat(&cx,"S%d:",n);
SHA3Update(&cx,(unsigned char*)z,n);
}
/* Compute a hash over the result of the query */
while( SQLITE_ROW==sqlite3_step(pStmt) ){