summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/sqlite/files/CVE-2023-36191.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-support/sqlite/files/CVE-2023-36191.patch')
-rw-r--r--meta/recipes-support/sqlite/files/CVE-2023-36191.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/meta/recipes-support/sqlite/files/CVE-2023-36191.patch b/meta/recipes-support/sqlite/files/CVE-2023-36191.patch
new file mode 100644
index 0000000000..aca79c334a
--- /dev/null
+++ b/meta/recipes-support/sqlite/files/CVE-2023-36191.patch
@@ -0,0 +1,37 @@
+From 4e8a0eb4e773b808d9e9697af94319599777169a Mon Sep 17 00:00:00 2001
+From: larrybr <larrybr@noemail.net>
+Date: Fri, 2 Jun 2023 12:56:32 +0000
+Subject: [PATCH] Fix CLI fault on missing -nonce reported by [forum:/info/f8c14a1134|forum post f8c14a1134].
+
+FossilOrigin-Name: cd24178bbaad4a1dafc3848e7d74240f90030160b5c43c93e1e0e11b073c2df5
+
+Upstream-Status: Backport [https://sqlite.org/src/info/cd24178bbaad4a1d
+Upstream commit https://github.com/sqlite/sqlite/commit/4e8a0eb4e773b808d9e9697af94319599777169a]
+CVE: CVE-2023-36191
+Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
+---
+ shell.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/shell.c b/shell.c
+index 0200c0a..fa45d40 100644
+--- a/shell.c
++++ b/shell.c
+@@ -23163,8 +23163,12 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
+ }else if( strcmp(z,"-bail")==0 ){
+ bail_on_error = 1;
+ }else if( strcmp(z,"-nonce")==0 ){
+- free(data.zNonce);
+- data.zNonce = strdup(argv[++i]);
++ if( data.zNonce ) free(data.zNonce);
++ if( i+1 < argc ) data.zNonce = strdup(argv[++i]);
++ else{
++ data.zNonce = 0;
++ break;
++ }
+ }else if( strcmp(z,"-safe")==0 ){
+ /* no-op - catch this on the second pass */
+ }
+--
+2.25.1
+