| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
If `nChangeset == 0`, the pointer `pChangeset` may be nullptr. Passing a nullptr to `memcpy()` is undefined behaviour. This can be triggered by running the test suite under UBSAN. Signed-off-by: ndossche <nora.dossche@ugent.be>
|
Review requested:
|
Sorry, something went wrong.
|
If sqlite3session_changeset returns SQLITE_OK the returned changeset is not nullptr. https://sqlite.org/session/sqlite3session_changeset.html
|
Sorry, something went wrong.
Codecov Report❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
@@ Coverage Diff @@
## main #63637 +/- ##
==========================================
- Coverage 90.30% 90.29% -0.02%
==========================================
Files 730 730
Lines 234802 234804 +2
Branches 43957 43951 -6
==========================================
- Hits 212041 212017 -24
- Misses 14485 14493 +8
- Partials 8276 8294 +18
... and 31 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
Well, I tested this without error injection, so perhaps the documentation is wrong. This success return path takes the size and pointer from the buf object, which is initialized to all zero bytes at the start of the function. If the loop does not run then both the pointer and size will be nullptr/0. |
Sorry, something went wrong.
There was a problem hiding this comment.
This success return path takes the size and pointer from the buf object, which is initialized to all zero bytes at the start of the function. If the loop does not run then both the pointer and size will be nullptr/0.
This analysis appears correct to me, although libc's are realistically going to handle this gracefully, even if technically UB.
(It's becoming defined behaviour in c2y 😃)
Sorry, something went wrong.
Right, although the main concern is what a smart compiler may do ;p
Fortunately |
Sorry, something went wrong.
|
OK maybe we should report this upstream, the SQLite folks are amazingly responsive. |
Sorry, something went wrong.
Sorry, something went wrong.
If `nChangeset == 0`, the pointer `pChangeset` may be nullptr. Passing a nullptr to `memcpy()` is undefined behaviour. This can be triggered by running the test suite under UBSAN. Signed-off-by: ndossche <nora.dossche@ugent.be> PR-URL: #63637 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
If `nChangeset == 0`, the pointer `pChangeset` may be nullptr. Passing a nullptr to `memcpy()` is undefined behaviour. This can be triggered by running the test suite under UBSAN. Signed-off-by: ndossche <nora.dossche@ugent.be> PR-URL: #63637 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
| Back | FazBrowse Home | New Git URL |
If nChangeset == 0, the pointer pChangeset may be nullptr. Passing a nullptr to memcpy() is undefined behaviour. This can be triggered by running the test suite under UBSAN.
../src/node_sqlite.cc:3342:42: runtime error: null pointer passed as argument 1, which is declared to never be null /usr/include/string.h:44:28: note: nonnull attribute specified here #0 0x64b18916cde5 in void node::sqlite::Session::Changeset<&sqlite3session_changeset>(v8::FunctionCallbackInfo<v8::Value> const&) /work/node/out/../src/node_sqlite.cc:3342:3 #1 0x7c81ae412f8c in Builtins_CallApiCallbackGeneric embedded.o #2 0x7c818e751ff0 (<unknown module>)Note: this was found by a static-dynamic analyser I'm developing.