Fix segfault in 'eval.c' extension when used with 'empty_result_callbacks'.

FossilOrigin-Name: e8b87bd4954437041139344d6d1ce3e4aace40ea6891b70f9c20cd95671270e7
This commit is contained in:
mistachkin 2018-04-04 12:21:33 +00:00
parent b14e6de579
commit 33fc27790a
4 changed files with 14 additions and 9 deletions

View File

@ -34,6 +34,7 @@ struct EvalResult {
static int callback(void *pCtx, int argc, char **argv, char **colnames){
struct EvalResult *p = (struct EvalResult*)pCtx;
int i;
if( argv==0 ) return 0;
for(i=0; i<argc; i++){
const char *z = argv[i] ? argv[i] : "";
size_t sz = strlen(z);

View File

@ -1,5 +1,5 @@
C Fix\san\serror\smessage\sin\sspeedtest1.c\sand\smake\sthe\s"trigger"\stestset\ssensitive\nto\sthe\s--size\sparameter.
D 2018-04-03T20:44:53.668
C Fix\ssegfault\sin\s'eval.c'\sextension\swhen\sused\swith\s'empty_result_callbacks'.
D 2018-04-04T12:21:33.105
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F Makefile.in 7016fc56c6b9bfe5daac4f34be8be38d8c0b5fab79ccbfb764d3b23bf1c6fff3
@ -276,7 +276,7 @@ F ext/misc/completion.c 0d0bd16378415b982e7119baddef52a0d2cc25860c238a9d2832b0cc
F ext/misc/compress.c dd4f8a6d0baccff3c694757db5b430f3bbd821d8686d1fc24df55cf9f035b189
F ext/misc/csv.c 1a009b93650732e22334edc92459c4630b9fa703397cbb3c8ca279921a36ca11
F ext/misc/dbdump.c 22018e00eb50e9ebf9067c92d4e7162dc5006a3efc4e0c19bc3829825a1043b0
F ext/misc/eval.c f971962e92ebb8b0a4e6b62949463ee454d88fa2
F ext/misc/eval.c 6ea9b22a5fa0dd973b67ca4e53555be177bc0b7b263aadf1024429457c82c0e3
F ext/misc/fileio.c 48c7751c78fc4cdd29d8c862fd2f3f98bbfefa2a3cf1ca1496df4bf02eb8cded
F ext/misc/fuzzer.c 7c64b8197bb77b7d64eff7cac7848870235d4c25
F ext/misc/ieee754.c f190d0cc5182529acb15babd177781be1ac1718c
@ -1084,7 +1084,7 @@ F test/misc4.test 0d8be3466adf123a7791a66ba2bc8e8d229e87f3
F test/misc5.test 60e1fc758a93cacd19eb2fafcd1d40d150a05047546c7a92389c98047d621901
F test/misc6.test 953cc693924d88e6117aeba16f46f0bf5abede91
F test/misc7.test 567e223b6497da2226a0340befaf2d663c91ad57a48aede21a35a984a2882d41
F test/misc8.test ba03aaa08f02d62fbb8d3b2f5595c1b33aa9bbc5
F test/misc8.test 8fb0f31d7a8aed484d759773ab8ad12ec746a477f4a67394a4af0e677494c3ca
F test/misuse.test 9e7f78402005e833af71dcab32d048003869eca5abcaccc985d4f8dc1d86bcc7
F test/mjournal.test 9d86e697dcbc5da2c4e8caba9b176b5765fe65e80c88c278b8c09a917e436795
F test/mmap1.test d2cfc1635171c434dcff0ece2f1c8e0a658807ce
@ -1717,7 +1717,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 7b7fa5fa0dd0dcef759ce1e22ade3a4e5fc8e8a244eac19b1abcc96d89c99721
R 4baf7dc282facc745e10c22f77c36581
U drh
Z bb4f0f244fe21a9d00e9e91cf5ed18f3
P 5a6fd9e0156a14e6509c4ea713c4b332b2d050432b49571c7a45a7ecc7cb5da4
R 5a45265c7da1e842aabe17d258d46bde
U mistachkin
Z cc22acb491f17ca746974111b657ca77

View File

@ -1 +1 @@
5a6fd9e0156a14e6509c4ea713c4b332b2d050432b49571c7a45a7ecc7cb5da4
e8b87bd4954437041139344d6d1ce3e4aace40ea6891b70f9c20cd95671270e7

View File

@ -57,6 +57,10 @@ do_catchsql_test misc8-1.7 {
ORDER BY rowid;
} {1 {abort due to ROLLBACK}}
do_catchsql_test misc8-1.8 {
PRAGMA empty_result_callbacks = 1;
SELECT eval('SELECT * FROM t1 WHERE 1 = 0;');
} {0 {{}}}
reset_db