Skip to content
Snippets Groups Projects
Commit 54c875bd authored by Apertis CI robot's avatar Apertis CI robot
Browse files

Merge updates from debian/bullseye

parents 8ed4288e ddc30bfc
Branches debian/bullseye-nonfree
Tags debian/1.20200212-1
2 merge requests!3Backport v2022 <- v2023dev1: Update from debian/bullseye,!2Update from debian/bullseye for apertis/v2023dev1
libencode-perl (3.08-1+deb11u2) bullseye; urgency=medium
* Fix memory leak.
Add patch rt_139622_memory-leak.patch, taken from upstream releases 3.13,
3.14, 3.15 to fix a memory leak in Encode.xs.
Cf. https://rt.cpan.org/Ticket/Display.html?id=139622
(Closes: #995804)
-- gregor herrmann <gregoa@debian.org> Mon, 01 Nov 2021 16:15:54 +0100
libencode-perl (3.08-1+deb11u1+apertis0) apertis; urgency=medium
* Sync from debian/bullseye-security.
......
Description: Fix memory leak
Origin: upstream releases 3.13, 3.14, 3.15
Bug-Debian: https://bugs.debian.org/995804
Bug: https://rt.cpan.org/Ticket/Display.html?id=139622
Reviewed-by: gregor herrmann <gregoa@debian.org>
Last-Update: 2021-11-01
--- a/Encode.xs
+++ b/Encode.xs
@@ -154,7 +154,7 @@ encode_method(pTHX_ const encode_t * enc
STRLEN sdone = 0;
/* We allocate slen+1.
PerlIO dumps core if this value is smaller than this. */
- SV *dst = newSV(slen+1);
+ SV *dst = sv_2mortal(newSV(slen+1));
U8 *d = (U8 *)SvPVX(dst);
STRLEN dlen = SvLEN(dst)-1;
int code = 0;
@@ -810,13 +810,12 @@ CODE:
tmp = encode_method(aTHX_ enc, enc->t_utf8, src, s, slen, check,
&offset, term, &code, fallback_cb);
sv_catsv(dst, tmp);
- SvREFCNT_dec(tmp);
SvIV_set(off, (IV)offset);
RETVAL = (code == ENCODE_FOUND_TERM);
OUTPUT:
RETVAL
-SV *
+void
Method_decode(obj,src,check_sv = &PL_sv_no)
SV * obj
SV * src
@@ -828,6 +827,7 @@ PREINIT:
encode_t *enc;
U8 *s;
STRLEN slen;
+ SV *ret;
INIT:
SvGETMAGIC(src);
SvGETMAGIC(check_sv);
@@ -841,13 +841,13 @@ CODE:
s = modify ? (U8 *)SvPV_force_nomg(src, slen) : (U8 *)SvPV_nomg(src, slen);
if (SvUTF8(src))
utf8_safe_downgrade(aTHX_ &src, &s, &slen, modify);
- RETVAL = encode_method(aTHX_ enc, enc->t_utf8, src, s, slen, check,
+ ret = encode_method(aTHX_ enc, enc->t_utf8, src, s, slen, check,
NULL, Nullsv, NULL, fallback_cb);
- SvUTF8_on(RETVAL);
-OUTPUT:
- RETVAL
+ SvUTF8_on(ret);
+ ST(0) = ret;
+ XSRETURN(1);
-SV *
+void
Method_encode(obj,src,check_sv = &PL_sv_no)
SV * obj
SV * src
@@ -859,6 +859,7 @@ PREINIT:
encode_t *enc;
U8 *s;
STRLEN slen;
+ SV *ret;
INIT:
SvGETMAGIC(src);
SvGETMAGIC(check_sv);
@@ -872,10 +873,10 @@ CODE:
s = modify ? (U8 *)SvPV_force_nomg(src, slen) : (U8 *)SvPV_nomg(src, slen);
if (!SvUTF8(src))
utf8_safe_upgrade(aTHX_ &src, &s, &slen, modify);
- RETVAL = encode_method(aTHX_ enc, enc->f_utf8, src, s, slen, check,
+ ret = encode_method(aTHX_ enc, enc->f_utf8, src, s, slen, check,
NULL, Nullsv, NULL, fallback_cb);
-OUTPUT:
- RETVAL
+ ST(0) = ret;
+ XSRETURN(1);
bool
Method_needs_lines(obj)
0001-mitigate-INC-pollution-when-loading-ConfigLocal.patch
rt_139622_memory-leak.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment