diff options
-rw-r--r-- | debian/patches/cherry-pick-727b493e-50736-silence-use-after-free-warning.patch | 36 | ||||
-rw-r--r-- | debian/patches/series | 1 |
2 files changed, 37 insertions, 0 deletions
diff --git a/debian/patches/cherry-pick-727b493e-50736-silence-use-after-free-warning.patch b/debian/patches/cherry-pick-727b493e-50736-silence-use-after-free-warning.patch new file mode 100644 index 000000000..c1fc7adc4 --- /dev/null +++ b/debian/patches/cherry-pick-727b493e-50736-silence-use-after-free-warning.patch @@ -0,0 +1,36 @@ +From 727b493e2b782fca0f3933865faa9a0a6ab1a2c4 Mon Sep 17 00:00:00 2001 +From: Wesley Schwengle <wesleys@opperschaap.net> +Date: Mon, 17 Oct 2022 13:13:13 +0900 +Subject: [PATCH] 50736: silence use-after-free warning (gcc-12.2) + +--- a/Src/Zle/compmatch.c ++++ b/Src/Zle/compmatch.c +@@ -2045,12 +2045,12 @@ + zlelineasstring(line, mp->llen, 0, &convlen, + NULL, 0); + if (rr <= convlen) { +- char *or = rs; ++ ptrdiff_t diff = rp - rs; + int alloclen = (convlen > 20) ? convlen : 20; + + rs = realloc(rs, (rl += alloclen)); + rr += alloclen; +- rp += rs - or; ++ rp = rs + diff; + } + memcpy(rp, convstr, convlen); + rp += convlen; +@@ -2073,11 +2073,11 @@ + } else { + /* Same character, just take it. */ + if (rr <= 1 /* HERE charlen */) { +- char *or = rs; ++ ptrdiff_t diff = rp - rs; + + rs = realloc(rs, (rl += 20)); + rr += 20; +- rp += rs - or; ++ rp = rs + diff; + } + /* HERE: multibyte char */ + *rp++ = *sa; diff --git a/debian/patches/series b/debian/patches/series index 2d9fb578a..bb3322aa1 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -13,3 +13,4 @@ cherry-pick-ecd3f9c9-1057610-support-texinfo-7.0.patch cherry-pick-4c89849c-50641-use-int-main-in-test-C-codes-in-configure.patch cherry-pick-ab4d62eb-52383-Avoid-incompatible-pointer-types-in-terminfo-global.patch cherry-pick-0bb140f9-52999-import-OLDPWD-from-environment-if-set.patch +cherry-pick-727b493e-50736-silence-use-after-free-warning.patch |