Skip to content

Improved security of the library against SQL injection attacks#4

Open
jkalias wants to merge 3 commits intomainfrom
security-fix
Open

Improved security of the library against SQL injection attacks#4
jkalias wants to merge 3 commits intomainfrom
security-fix

Conversation

@jkalias
Copy link
Copy Markdown
Owner

@jkalias jkalias commented May 6, 2026

No description provided.

@jkalias jkalias self-assigned this May 6, 2026
@jkalias
Copy link
Copy Markdown
Owner Author

jkalias commented May 6, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e7082a2478

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/queries.cc

case SqliteStorageClass::kText:
case SqliteStorageClass::kDateTime:
sqlite3_bind_text(stmt, index, value.text_value.data(), -1, SQLITE_TRANSIENT);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Bind text with its actual byte length

When a reflected std::wstring contains an embedded NUL, StringUtilities::ToUtf8 preserves it in text_value, but passing -1 tells SQLite to measure only up to the first zero terminator. Saving or querying values such as std::wstring(L"a\0b", 3) therefore silently binds only "a", corrupting stored text and making exact predicates against such strings wrong; pass text_value.size() as the byte count instead.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant