Uh oh!
There was an error while loading. Please reload this page.
sqlite: check null returns from sqlite value functions - #63288
Conversation
nodejs-github-bot
commented
May 13, 2026
Review requested:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@## main #63288 +/- ##
==========================================
- Coverage 90.30% 90.29% -0.01%
==========================================
Files 759 759 Lines 247754 247754 Branches 46716 46720 +4 ==========================================
- Hits 223724 223719 -5 - Misses 15483 15512 +29 + Partials 8547 8523 -24
🚀 New features to boost your workflow:
|
trivikr
commented
Aug 6, 2026
@ndossche Can you please rebase and force push? |
sqlite3_column_text() can return nullptr on failure which was not handled. sqlite3_column_blob() can return nullptr for zero-length BLOBs, which is then passed to memcpy() which is UB. Avoid this by checking for a nullptr. Signed-off-by: ndossche <nora.dossche@ugent.be>
ndossche
commented
Aug 6, 2026
Done, CI (so far) is looking okay |
trivikr
commented
Aug 6, 2026
Can you add some regression tests? Ones which fail in main, but succeed with the fix? |
ndossche
commented
Aug 6, 2026
Apparently the current test suite can already trigger the "UB blob" problem, but the test runner ignores UBSAN failures, so you never see this as a failure. As for the allocation failure in |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
nodejs-github-bot
commented
Aug 8, 2026
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot
commented
Aug 9, 2026
Landed in 330f7b5 |
sqlite3_column_text() can return nullptr on failure which was not handled. sqlite3_column_blob() can return nullptr for zero-length BLOBs, which is then passed to memcpy() which is UB. Avoid this by checking for a nullptr. Signed-off-by: ndossche <nora.dossche@ugent.be> PR-URL: #63288 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
sqlite3_column_text() can return nullptr on failure which was not handled. sqlite3_column_blob() can return nullptr for zero-length BLOBs, which is then passed to memcpy() which is UB. Avoid this by checking for a nullptr. Signed-off-by: ndossche <nora.dossche@ugent.be> PR-URL: #63288 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
sqlite3_column_text() can return nullptr on failure which was not handled. sqlite3_column_blob() can return nullptr for zero-length BLOBs, which is then passed to memcpy() which is UB. Avoid this by checking for a nullptr. Signed-off-by: ndossche <nora.dossche@ugent.be> PR-URL: #63288 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
sqlite3_column_text() can return nullptr on failure which was not handled. sqlite3_column_blob() can return nullptr for zero-length BLOBs, which is then passed to memcpy() which is UB. Avoid this by checking for a nullptr.
Note: this was found by a static-dynamic analyser I'm developing.