Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 8a0d629

Browse files
[[ Bug 15416 ]] Make sure that invalid placeholders for SQLite query are not letting the query build
1 parent aee0e3d commit 8a0d629

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

docs/notes/bugfix-15416.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Crash when building a SQLite query with out-of-bounds placeholders

revdb/src/sqlite_connection.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,12 @@ bool queryCallback(void *p_context, int p_placeholder, DBBuffer& p_output)
387387
{
388388
QueryMetadata *t_query_metadata;
389389
t_query_metadata = (QueryMetadata *)p_context;
390+
391+
392+
// SN-2015-06-01: [[ Bug 15416 ]] Make sure that we don't access an out-of-
393+
// bounds placeholder.
394+
if (p_placeholder > t_query_metadata -> argument_count)
395+
return false;
390396

391397
DBString t_parameter_value;
392398
t_parameter_value = t_query_metadata -> arguments[p_placeholder - 1];

0 commit comments

Comments
 (0)