diff --git a/0005-uninitialized-value-used-in-pattern-compare.patch b/0005-uninitialized-value-used-in-pattern-compare.patch new file mode 100644 index 0000000000000000000000000000000000000000..841b0455f178c9b2298782834c94ed8b1e6b7784 --- /dev/null +++ b/0005-uninitialized-value-used-in-pattern-compare.patch @@ -0,0 +1,28 @@ +diff -Nur sqlite_before/src/func.c sqlite_after/src/func.c +--- sqlite_before/src/func.c 2021-09-26 16:11:20.573041810 +0800 ++++ sqlite_after/src/func.c 2021-09-26 16:16:56.535137866 +0800 +@@ -694,7 +694,8 @@ + /* Skip over multiple "*" characters in the pattern. If there + ** are also "?" characters, skip those as well, but consume a + ** single character of the input string for each "?" skipped */ +- while( (c=Utf8Read(zPattern)) == matchAll || c == matchOne ){ ++ while( (c=Utf8Read(zPattern)) == matchAll ++ || (c == matchOne && matchOne!=0) ){ + if( c==matchOne && sqlite3Utf8Read(&zString)==0 ){ + return SQLITE_NOWILDCARDMATCH; + } +diff -Nur sqlite_before/test/like.test sqlite_after/test/like.test +--- sqlite_before/test/like.test 2021-09-26 16:11:20.561041592 +0800 ++++ sqlite_after/test/like.test 2021-09-26 16:17:03.575265610 +0800 +@@ -1131,4 +1131,11 @@ + SELECT id FROM t1 WHERE x LIKE 'abc__' ESCAPE '_'; + } {2} + ++# 2021-02-15 ticket c0aeea67d58ae0fd ++# ++do_execsql_test 17.1 { ++ SELECT 'x' LIKE '%' ESCAPE '_'; ++} {1} ++ ++ + finish_test diff --git a/sqlite.spec b/sqlite.spec index 48c0e61978b5cb2ec8779e845d62d4051b603b79..ade1be9656cd6620bf4432b59a541b92b493f09d 100644 --- a/sqlite.spec +++ b/sqlite.spec @@ -6,7 +6,7 @@ Name: sqlite Version: 3.34.0 -Release: 3 +Release: 4 Summary: Embeded SQL database License: Public Domain URL: http://www.sqlite.org/ @@ -19,6 +19,7 @@ Patch1: 0001-sqlite-no-malloc-usable-size.patch Patch2: 0002-remove-fail-testcase-in-no-free-fd-situation.patch Patch3: 0003-infinite-loop-in-trim-function.patch Patch4: 0004-null-ref-in-trigger.patch +Patch5: 0005-uninitialized-value-used-in-pattern-compare.patch BuildRequires: gcc autoconf tcl tcl-devel BuildRequires: ncurses-devel readline-devel glibc-devel @@ -65,6 +66,7 @@ This contains man files and HTML files for the using of sqlite. %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 rm -f %{name}-doc-%{extver}/sqlite.css~ || : @@ -135,6 +137,9 @@ make test %{_mandir}/man*/* %changelog +* Fri Sep 26 2021 wbq_sky - 3.34.0-4 +- fix the uninitialized value used in pattern match. + * Fri Sep 3 2021 wbq_sky - 3.34.0-3 - fix the null reference in the tigger statement.