From a5d356ed8e64adac8f63c1f889f99effd8e25f75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Sat, 30 Nov 2024 20:07:45 +0100 Subject: [PATCH] Add patch --- data-raw/upgrade.R | 5 +++++ patch/0001-Function-pointer-safety.patch | 26 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 patch/0001-Function-pointer-safety.patch diff --git a/data-raw/upgrade.R b/data-raw/upgrade.R index b02b256ef..e13d48ba9 100644 --- a/data-raw/upgrade.R +++ b/data-raw/upgrade.R @@ -64,6 +64,11 @@ register_misc_extension("series") register_misc_extension("csv") register_misc_extension("uuid") +for (f in dir("patch", full.names = TRUE)) { + message("Applying ", f) + stopifnot(system(paste0("patch -p1 -i ", f)) == 0) +} + if (any(grepl("^src/", gert::git_status()$file))) { gert::git_add("src") diff --git a/patch/0001-Function-pointer-safety.patch b/patch/0001-Function-pointer-safety.patch new file mode 100644 index 000000000..fbcd62ca0 --- /dev/null +++ b/patch/0001-Function-pointer-safety.patch @@ -0,0 +1,26 @@ +From 3a9012f07d9f7da290809d89549b663a75fd4e6b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Kirill=20M=C3=BCller?= +Date: Sat, 30 Nov 2024 20:04:14 +0100 +Subject: [PATCH] Function pointer safety + +--- + src/vendor/extensions/regexp.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/vendor/extensions/regexp.c b/src/vendor/extensions/regexp.c +index 18266493..340357ea 100644 +--- a/src/vendor/extensions/regexp.c ++++ b/src/vendor/extensions/regexp.c +@@ -656,7 +656,8 @@ static const char *re_subcompile_string(ReCompiled *p){ + ** regular expression. Applications should invoke this routine once + ** for every call to re_compile() to avoid memory leaks. + */ +-static void re_free(ReCompiled *pRe){ ++static void re_free(void *pRe_){ ++ ReCompiled *pRe = (ReCompiled*)pRe_; + if( pRe ){ + sqlite3_free(pRe->aOp); + sqlite3_free(pRe->aArg); +-- +2.43.0 +