Skip to content

Commit

Permalink
Add patch
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Nov 30, 2024
1 parent 3a9012f commit a5d356e
Showing 2 changed files with 31 additions and 0 deletions.
5 changes: 5 additions & 0 deletions data-raw/upgrade.R
Original file line number Diff line number Diff line change
@@ -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")

26 changes: 26 additions & 0 deletions patch/0001-Function-pointer-safety.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From 3a9012f07d9f7da290809d89549b663a75fd4e6b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kirill=20M=C3=BCller?= <kirill@cynkra.com>
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

0 comments on commit a5d356e

Please sign in to comment.