diff options
Diffstat (limited to 'onig-6.9.9-fix-memleaks-initialize-memory.patch')
-rw-r--r-- | onig-6.9.9-fix-memleaks-initialize-memory.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/onig-6.9.9-fix-memleaks-initialize-memory.patch b/onig-6.9.9-fix-memleaks-initialize-memory.patch new file mode 100644 index 0000000..7c7fb16 --- /dev/null +++ b/onig-6.9.9-fix-memleaks-initialize-memory.patch @@ -0,0 +1,38 @@ +diff -up onig-6.9.9/src/regexec.c.orig onig-6.9.9/src/regexec.c +--- onig-6.9.9/src/regexec.c.orig 2022-12-12 14:27:04.000000000 +0100 ++++ onig-6.9.9/src/regexec.c 2024-07-29 12:30:55.752328341 +0200 +@@ -4517,6 +4517,7 @@ regset_search_body_position_lead(OnigReg + + sr = (SearchRange* )xmalloc(sizeof(*sr) * n); + CHECK_NULL_RETURN_MEMERR(sr); ++ xmemset(sr, 0, sizeof(*sr) * n); + + for (i = 0; i < n; i++) { + reg = set->rs[i].reg; +diff -up onig-6.9.9/src/regparse.c.orig onig-6.9.9/src/regparse.c +--- onig-6.9.9/src/regparse.c.orig 2024-07-29 12:31:07.838347726 +0200 ++++ onig-6.9.9/src/regparse.c 2024-07-29 12:33:48.509582274 +0200 +@@ -4190,7 +4190,10 @@ and_cclass(CClassNode* dest, CClassNode* + pbuf = tbuf; + } + } +- if (r != 0) return r; ++ if (r != 0) { ++ bbuf_free(pbuf); ++ return r; ++ } + + dest->mbuf = pbuf; + bbuf_free(buf1); +@@ -4247,7 +4250,10 @@ or_cclass(CClassNode* dest, CClassNode* + pbuf = tbuf; + } + } +- if (r != 0) return r; ++ if (r != 0) { ++ bbuf_free(pbuf); ++ return r; ++ } + + dest->mbuf = pbuf; + bbuf_free(buf1); |