Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package perl-Cpanel-JSON-XS for
openSUSE:Factory checked in at 2026-11-27 19:42:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Cpanel-JSON-XS (Old)
and /work/SRC/openSUSE:Factory/.perl-Cpanel-JSON-XS.new.1340718 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Cpanel-JSON-XS"
Fri Nov 27 19:42:26 2026 rev:50 rq:1400983 version:4.830.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Cpanel-JSON-XS/perl-Cpanel-JSON-XS.changes
2026-11-18 18:34:07.707409174 +0100
+++
/work/SRC/openSUSE:Factory/.perl-Cpanel-JSON-XS.new.1340718/perl-Cpanel-JSON-XS.changes
2026-11-27 19:44:27.402433503 +0100
@@ -1,0 +2,26 @@
+Mon Nov 23 16:02:22 UTC 2026 - Tina Müller <[email protected]>
+
+- updated to 4.830.0 (4.83)
+ see /usr/share/doc/packages/perl-Cpanel-JSON-XS/Changes
+
+ 4.83 2026-11-23 (rurban)
+
+ - Security fixes, reported by Albert Gierlach (rivit):
+ * decode: free the temporary encoding name when the input starts with
+ a UTF-16 or UTF-32 BOM (leak of a scalar per call, successful or
+ not). CVE-2026-134876
+ * decode: with allow_tags free the enclosing arrays and hashes when
+ a THAW method dies (leak). CVE-2026-134877
+ * decode: free the key of every enclosing object member when a
+ filter_json_object or filter_json_single_key_object callback dies
+ or a THAW method dies (leak). CVE-2026-134878
+ * encode: encode_stringify freed neither its string copy nor the
+ overloaded object when encode_str croaked on malformed UTF-8,
+ e.g. with allow_stringify (leak). CVE-2026-134879
+ - encode: no signed overflow negating IV_MIN with JSON_TYPE_INT, and
+ no read of uninitialized memory when checking short formatted numbers
+ and bignum strings for inf and nan.
+ - utf8_range: cast byte constants to char for _mm_set1_epi8
+ (clang -Wconstant-conversion).
+
+-------------------------------------------------------------------
Old:
----
Cpanel-JSON-XS-4.82.tar.gz
New:
----
Cpanel-JSON-XS-4.83.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Cpanel-JSON-XS.spec ++++++
--- /var/tmp/diff_new_pack.QHJ4Pw/_old 2026-11-27 19:44:28.361474032 +0100
+++ /var/tmp/diff_new_pack.QHJ4Pw/_new 2026-11-27 19:44:28.364474159 +0100
@@ -18,10 +18,10 @@
%define cpan_name Cpanel-JSON-XS
Name: perl-Cpanel-JSON-XS
-Version: 4.820.0
+Version: 4.830.0
Release: 0
-# 4.82 -> normalize -> 4.820.0
-%define cpan_version 4.82
+# 4.83 -> normalize -> 4.830.0
+%define cpan_version 4.83
License: Artistic-1.0 OR GPL-1.0-or-later
Summary: CPanel fork of JSON::XS, fast and correct serializing
URL: https://metacpan.org/release/%{cpan_name}
++++++ Cpanel-JSON-XS-4.82.tar.gz -> Cpanel-JSON-XS-4.83.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Cpanel-JSON-XS-4.82/Changes
new/Cpanel-JSON-XS-4.83/Changes
--- old/Cpanel-JSON-XS-4.82/Changes 2026-11-16 13:28:23.000000000 +0100
+++ new/Cpanel-JSON-XS-4.83/Changes 2026-11-23 09:47:44.000000000 +0100
@@ -2,26 +2,47 @@
TODO: http://stevehanov.ca/blog/index.php?id=104 compression
+4.83 2026-11-23 (rurban)
+
+ - Security fixes, reported by Albert Gierlach (rivit):
+ * decode: free the temporary encoding name when the input starts with
+ a UTF-16 or UTF-32 BOM (leak of a scalar per call, successful or
+ not). CVE-2026-134876
+ * decode: with allow_tags free the enclosing arrays and hashes when
+ a THAW method dies (leak). CVE-2026-134877
+ * decode: free the key of every enclosing object member when a
+ filter_json_object or filter_json_single_key_object callback dies
+ or a THAW method dies (leak). CVE-2026-134878
+ * encode: encode_stringify freed neither its string copy nor the
+ overloaded object when encode_str croaked on malformed UTF-8,
+ e.g. with allow_stringify (leak). CVE-2026-134879
+ - encode: no signed overflow negating IV_MIN with JSON_TYPE_INT, and
+ no read of uninitialized memory when checking short formatted numbers
+ and bignum strings for inf and nan.
+ - utf8_range: cast byte constants to char for _mm_set1_epi8
+ (clang -Wconstant-conversion).
+
4.82 2026-11-16 (rurban)
- Security fixes, reported by Albert Gierlach (rivit):
* encode: JSON_TYPE_BOOL of a reference to a scalar other than 0 or 1
- crashed (NULL stash) instead of croaking.
+ crashed (NULL stash) instead of croaking. CVE-2026-130883
* encode: JSON_TYPE_FLOAT with allow_bignum and an integer value
- overflowed the buffer by the appended ".0".
+ overflowed the buffer by the appended ".0". CVE-2026-130882
* encode: convert_blessed no longer expands Math::BigFloat objects
- with a huge exponent into digits (memory exhaustion).
+ with a huge exponent into digits (memory exhaustion).
CVE-2026-110676
* decode: free the partial string on errors (leak of ~16KB per
- document with strings > 16KB).
+ document with strings > 16KB). CVE-2026-131934
* decode: free enclosing arrays and hashes when a filter_json_object
- or filter_json_single_key_object callback dies (leak).
+ or filter_json_single_key_object callback dies (leak).
CVE-2026-131932
* decode: -9223372036854775808 negated IV_MIN (undefined behaviour).
+ CVE-2026-131931
* incr_parse: a NUL byte between values is now an error and no longer
- stalls the parser while the buffer grows forever.
+ stalls the parser while the buffer grows forever. CVE-2026-131937
* incr_parse: keep incr_pos consistent when the downgrade fails with
wide characters, and never underflow it when the incremental scanner
and the decoder disagree (allow_barekey). Fixes out-of-bounds
- writes in incr_parse after incr_skip.
+ writes in incr_parse after incr_skip. CVE-2026-130881
- t/10_pc_keysort fix for perls older then 5.20, introduced with 4.81
(GH #262 eserte)
4.81 2026-11-09 (rurban)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Cpanel-JSON-XS-4.82/META.json
new/Cpanel-JSON-XS-4.83/META.json
--- old/Cpanel-JSON-XS-4.82/META.json 2026-11-16 13:28:56.000000000 +0100
+++ new/Cpanel-JSON-XS-4.83/META.json 2026-11-23 09:48:25.000000000 +0100
@@ -100,7 +100,7 @@
"url" : "https://github.com/rurban/Cpanel-JSON-XS"
}
},
- "version" : "4.82",
+ "version" : "4.83",
"x_contributors" : [
"Ashley Willis <[email protected]>",
"Chip Salzenberg <[email protected]>",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Cpanel-JSON-XS-4.82/META.yml
new/Cpanel-JSON-XS-4.83/META.yml
--- old/Cpanel-JSON-XS-4.82/META.yml 2026-11-16 13:28:55.000000000 +0100
+++ new/Cpanel-JSON-XS-4.83/META.yml 2026-11-23 09:48:25.000000000 +0100
@@ -48,7 +48,7 @@
bugtracker: https://github.com/rurban/Cpanel-JSON-XS/issues
license: http://dev.perl.org/licenses/
repository: https://github.com/rurban/Cpanel-JSON-XS
-version: '4.82'
+version: '4.83'
x_contributors:
- 'Ashley Willis <[email protected]>'
- 'Chip Salzenberg <[email protected]>'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Cpanel-JSON-XS-4.82/SIGNATURE
new/Cpanel-JSON-XS-4.83/SIGNATURE
--- old/Cpanel-JSON-XS-4.82/SIGNATURE 2026-11-16 13:28:56.000000000 +0100
+++ new/Cpanel-JSON-XS-4.83/SIGNATURE 2026-11-23 09:48:25.000000000 +0100
@@ -20,16 +20,16 @@
SHA256 a3c34aba52e269e6cec558ecf9cff393138574189fdff26b183bee9cc2e0434f
.travis.yml
SHA256 c3f2a1a4f66382f796f71a571946722edba53cf3238152b26fd325f4c2f1a20f
.whitesource
SHA256 8de3540a3cd7ecc9a9dcb48975fe852c082fe17d4462f87bb72aa7cc47f083ad COPYING
-SHA256 48794ef12557ceddcbe9178d8b53ec8f55b479a16eef5695caa81c90bfcd206a Changes
+SHA256 21fcf58682896edc89f22b06d0e10edfbb4b07a6e95f80354b8f8afdeacbf1e5 Changes
SHA256 c3a28bbfd1c94f9a60565ecbde58dfec82ab40525a4858c96832ac43ea7b6ca5
MANIFEST
-SHA256 b49609d7fd2bca60ca64dac175ca406279c071c4349a8ba64b59b72cf5d49498
META.json
-SHA256 7dced81850fa7a5359e727d66cbac03d1497444a24ff0ccc437f998061b7316d
META.yml
+SHA256 a9a1678d16dc4cb48f71a02cc423128a014852d4bc34bdf97579fa9bd7ab5556
META.json
+SHA256 86d724d86aec73a74d722556ac1da69be5d3b41d0322deb4b8bd7d499a6e3c1b
META.yml
SHA256 0ebe7b026805d3de5c4a51153c23123139d792d00300f433945047e21bbbe046
Makefile.PL
SHA256 a37ff25d51f52601fd5fa865281e3ec1b4235182ccb4b0be6445eff048c5f63d README
-SHA256 d4544253c39c3e61f7702799319c23d301334051eda1efb6d3ca399a2776b735 XS.pm
-SHA256 df1cb8c721daa77372f1311c8d416a81058a7b643390b40f4aed1f2552fc9cbe XS.xs
-SHA256 55d63c69096dab1d031c7964b0d1b76e36b79a17052c092729193f22012e124e
XS/Boolean.pm
-SHA256 dc2a6f4060e5789623c5b014ced5ab02f5e801544fb283bf895b23a196196eb7
XS/Type.pm
+SHA256 08a69c01a8aa6baacd96c9f266856c7a21acedd7561d5ec81ffd1b59e9e3ef3c XS.pm
+SHA256 b9695bfe4af9d6de0794aea118c9d7595b26054aeb4f7ea73c2fe217332ee602 XS.xs
+SHA256 bbc930e04496dc8a3a0fb1e2582615f414a3f2785c9566bbf2961342125bd45d
XS/Boolean.pm
+SHA256 16192ca4cf7179409e87fbff082ca39e9a14751fa68afa341aa2d921af535522
XS/Type.pm
SHA256 adca185de1f64d9861a3863ce44a3c3ac33fa478b0cb56a0aa309b8e40bcb577
bin/cpanel_json_xs
SHA256 0d188abe82c2270e7bc5fc21de1d8210bfc52118a834b22592781bb2879a6065
eg/bench
SHA256 215059161dfdee3a6ecaf0051ef766abbf5a83ef6f310a9b3b0abb3b574d6b0d
eg/bench_large.pl
@@ -69,10 +69,10 @@
SHA256 d3e5a27528e434aa211768121f26dd5462d5d9f52840e61199011bc3031ecf7d
t/126_encode_to.t
SHA256 fff40e34735911841cdd7c7b68744437bdb5f568e44ca2b52c71e82ea17fe1d7
t/127_schema_validate.t
SHA256 3bb0a242d9ed6aca25a751287c055db98a653d914f14863bb0dfc251a60617de
t/128_threads_clone.t
-SHA256 0ae52036fbf42023f6059ca47ce3357d73c6bd779e568e4fcea8ec526783dc5c
t/129_stringify_leak.t
+SHA256 995af89a7c21e23ce36608faa3dd5cef827384f452bcff09a8e905532a4fe76d
t/129_stringify_leak.t
SHA256 3e538942c54bb33a4833726e342afd1a8ee029903156d51d9c3321ef51a8862e
t/12_blessed.t
-SHA256 ecc8c6c53a99dcaa76315f938779c98c1a36a64c0e6c6fa3372fb8be894f4d99
t/130_thaw_croak_leak.t
-SHA256 3839906116744e7144ca256c60d562c4f9e52977d61b49e920f6a04aeef7a0ca
t/131_filter_self_removal.t
+SHA256 9e9858d8e0d6567312055f60efe7373d861d069ff87e2e31dd8d55f46e631a0d
t/130_thaw_croak_leak.t
+SHA256 f7709b043d43e51d52089155f9cc714e0c0b2aff1382a94f14e1de04b76f7f13
t/131_filter_self_removal.t
SHA256 43a8dfc79182d0ea1462e9266bad1197bc172a9698c0fd002a8e9b0324112ca7
t/13_limit.t
SHA256 5500fcc9758d70d2c072957a5ac8829a879f648039e5d2f8502c2dc284989c54
t/14_latin1.t
SHA256 158b26605aebe84ab173858394924a04c20c2f8d69174d70c4f82ae52e403c5a
t/15_prefix.t
@@ -89,7 +89,7 @@
SHA256 837c64db6b940db32545072b17fc9a97dff6b8feaa832db1cb316b537e18595c
t/25_boolean.t
SHA256 9816f07555ec299857bf963182f029b7d815fa76657621c943a44ef3b9d6333a
t/26_duplicate.t
SHA256 6ce5e7e4851a2ce50ed38799428cdf89e4580a8cd2287770e46521163e493188
t/30_jsonspec.t
-SHA256 6bc069d1999c995c1b1216f5b69572c0d83057ba46dfea752010306892b9df39
t/31_bom.t
+SHA256 2dbcfca02b899d06f304377d50728768461694df78eda15b40debeccd1faa7d6
t/31_bom.t
SHA256 0363e944d11789ec3b7d6a7e7cfa89eca04702a7c590195ab2b70443f0655cc8
t/52_object.t
SHA256 3b9ce402e2d0cae8a525df4beca05f2656ba5cf02b074d02fd690fe97773d2d7
t/53_readonly.t
SHA256 449f91cc04f1c57fa0a2781b44a863ab0be6ed4e9e21ddf8b42a55ba3ee00be3
t/54_stringify.t
@@ -100,7 +100,7 @@
SHA256 f847d17e014f19232281a3f44184da5f6dc0d1efb2d817d03156d1ff3d152afa
t/97_unshare_hek.t
SHA256 e81d5910be174c0d4ba46688c2cbc195f91adcb6f896385860c6311e079f11ec
t/98_56only.t
SHA256 9fc914299ef9c35953f93cdce0d694394ab84337227d74cd0eafb831314cd568
t/99_binary.t
-SHA256 545820e5ecd273d1cb3be9df404bb72f6d62c311d19f2148375c89b797d5a517
t/_unicode_handling.pm
+SHA256 b02f6cef3dcb3a4f6780ab8b4c66e7c9f2d1cb4254cd64ca30db4d40f87804cb
t/_unicode_handling.pm
SHA256 61b20d1f63cbbf9a9dfd757117927cda492e1a5bab7ed0d2790c82321819f845
t/appveyor-test.bat
SHA256 92123944cf252563cc9d402ad83df085a20f9899144b3b59661f898fcffd1e2b
t/test_parsing/i_number_neg_int_huge_exp.json
SHA256 873f021ffd6efe214578e87c45c470aa1e6fba5507eae9f17f4ad3544c1278ff
t/test_parsing/i_number_pos_double_huge_exp.json
@@ -440,7 +440,7 @@
SHA256 229aba86ef5f6db75a1433f33c3c9c1e7e8978ed5161cf5135fa61c703e28bc8
t/test_transform/string_with_escaped_NULL.json
SHA256 3e18d8914dc41eed22b366375440bd57b0c8e81c6a710d9e4fe5ff14d499e94b
t/zero-mojibake.t
SHA256 5d2a2d9cf2cf8f5b2f89f6572f003994fc95bc9190425b30b1cb777c9650e8e0 typemap
-SHA256 e2f71ffaa19f653d9e0bce7a878f8cbcbd6dc6ebedd036b38abe1c2193c8de94
utf8_range.c
+SHA256 bf708c41a11bcae1c3173bffceca40b2e5474a6187cd28dcac341af5a0ed6a1d
utf8_range.c
SHA256 91f261464807a96a0c4c7a6929ef1f5af67f9eaf709291d365e93acc6b0174bd
utf8_range.h
SHA256 77b5bd227562c24336c1979a521c0b5721c06b012cf7e7fb21610208f0520357
xt/changes.t
SHA256 c32dc76195cae85cc51b2ee14d6999e2a1fd791162fcd3b0495e1ccdf1ecfd69
xt/checkchanges.t
@@ -458,15 +458,15 @@
SHA256 195f765492cf72780ccef3421b1aab37189dbab8764748e64c426fc9d0f41072
xt/versions.t
-----BEGIN PGP SIGNATURE-----
-iQGzBAEBAwAdFiEEOKQWew22nknF9yFsuMKIZqsnp6IFAmr69wgACgkQuMKIZqsn
-p6LEmwwA0QhBZro+EMgLBCB6uFJ1ew13hqy77imF7XiRJRwTkAfgijL6bZWXw1Va
-lz1jLLtA3QEQBRmywDQt+jKVXN3Dv+gtgc+jRiEClJYPsjlI/DRFGyEp3JjO7+TM
-xqh+S3siiqovmWXowD5xH1I5FS2BO/x9oHehhGoj5KqqDSgtYQXA/0k6sJtcUpu0
-1vU42QhV1NLvphTWOlgQTmBmqHlzo64HfRkD0qIV6VlDaoN0iUmsEfoo6I+AuxXZ
-jhy7zqvWkZu+dXnJYFnC/mgJy5GFNr1tLcGGSuMOXQVlrdeN0HHZS/gYG6e3l+YP
-uBjtO5iBeb8JsMKYlOcoVdHvOYdZNeQy5INKF3djOU1mD1xXHPiiwxLCGVNEdKt/
-dpXJB0x9P7rsMYtHF30HI+87UomojFMncj3Zk3yZMo9A5fZaSCrtbfRrIMnh9csV
-gFCA7OeRf2cL4NQ+boTrb+XXpEvR3Ms/xK5w/LtrHO6A8qKzzWCY4vDzH0nPI2jC
-LbjJo+4D
-=Dsvx
+iQGzBAEBAwAdFiEEOKQWew22nknF9yFsuMKIZqsnp6IFAmsD/dkACgkQuMKIZqsn
+p6ItmwwA2mAQThChAXhfPQf11AzAD+vvbYW8aOJ3KFeETNU/riW95ExTPFvybYSH
+MngSn7w6RnalbNbs/nV+yfGUgpbDZnNWwMdqoX3qNVdSjGamjzLf20qIyQTYj7I8
+rfOkC263AjPwvymdgCgUjtM1wY4xiCxDikSWnr3H5WRouLX0N1tVTweblJczGOPX
+Bm8RDJMSUhUFxskBLIIbbPUvdN7HoFHjDfQCyZiRsZLIU/AhugwiJ/2lvzR/fNCU
+BZCQ9KY/qPsGp/4ZObrpuuoZpgJm9SVuspz81A2/05BJ2klm/a1qgShhB+2r5gbO
+W3gstL0CpAW1NDGGKDk3jnNMo12/9z+MU7Lv1LslSIIqPRr2x4Yh75CcxdGyG8zK
+40pJqgnha8SDAQx5VHuQzB/VMAmwCdRqv3Snv2g6BcRDu+szKFIl1lQhXBtzUhl5
+cOwsEqpG1C78L8KRteAwOrGG27VSi1L4Ovon0mkteo5/ApcnKjxnfTU1ecPVOTAO
+eUhDgQmC
+=9vH7
-----END PGP SIGNATURE-----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Cpanel-JSON-XS-4.82/XS/Boolean.pm
new/Cpanel-JSON-XS-4.83/XS/Boolean.pm
--- old/Cpanel-JSON-XS-4.82/XS/Boolean.pm 2026-11-16 13:28:23.000000000
+0100
+++ new/Cpanel-JSON-XS-4.83/XS/Boolean.pm 2026-11-23 09:47:44.000000000
+0100
@@ -20,7 +20,7 @@
use Cpanel::JSON::XS ();
-our $VERSION = '4.82';
+our $VERSION = '4.83';
1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Cpanel-JSON-XS-4.82/XS/Type.pm
new/Cpanel-JSON-XS-4.83/XS/Type.pm
--- old/Cpanel-JSON-XS-4.82/XS/Type.pm 2026-11-16 13:28:23.000000000 +0100
+++ new/Cpanel-JSON-XS-4.83/XS/Type.pm 2026-11-23 09:47:44.000000000 +0100
@@ -1,6 +1,6 @@
package Cpanel::JSON::XS::Type;
-our $VERSION = '4.82';
+our $VERSION = '4.83';
=pod
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Cpanel-JSON-XS-4.82/XS.pm
new/Cpanel-JSON-XS-4.83/XS.pm
--- old/Cpanel-JSON-XS-4.82/XS.pm 2026-11-16 13:28:23.000000000 +0100
+++ new/Cpanel-JSON-XS-4.83/XS.pm 2026-11-23 09:47:44.000000000 +0100
@@ -1,5 +1,5 @@
package Cpanel::JSON::XS;
-our $VERSION = '4.82';
+our $VERSION = '4.83';
our $XS_VERSION = $VERSION;
# $VERSION = eval $VERSION;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Cpanel-JSON-XS-4.82/XS.xs
new/Cpanel-JSON-XS-4.83/XS.xs
--- old/Cpanel-JSON-XS-4.82/XS.xs 2026-11-16 13:28:23.000000000 +0100
+++ new/Cpanel-JSON-XS-4.83/XS.xs 2026-11-23 09:47:44.000000000 +0100
@@ -289,11 +289,13 @@
#define SvREFCNT_dec_NN(sv) SvREFCNT_dec(sv)
#endif
/* from cperl */
-#ifndef strEQc
-/* the buffer ends with \0, includes comparison of the \0.
- better than strEQ as it uses memcmp, word-wise comparison. */
-# define strEQc(s, c) memEQ(s, ("" c ""), sizeof(c))
-#endif
+/* s is a \0-terminated string: compares the \0 too, but never reads past it
+ (a formatted number is shorter than the constant, the buffer after its \0
+ is uninitialized). */
+#undef strEQc
+#define strEQc(s, c) (strncmp((s), ("" c ""), sizeof(c)) == 0)
+/* s is a \0-terminated string starting with c, the string s may continue */
+#define strPrefixc(s, c) (strncmp((s), ("" c ""), sizeof(c)-1) == 0)
#ifndef memEQc
/* excluding the final \0, so the string s may continue */
# define memEQc(s, c) memEQ(s, ("" c ""), sizeof(c)-1)
@@ -1855,7 +1857,7 @@
/* implement convert_blessed, sv is already unref'ed here */
static void
-encode_stringify(pTHX_ enc_t *enc, SV *sv, int isref)
+encode_stringify_(pTHX_ enc_t *enc, SV *sv, int isref)
{
char *str = NULL;
STRLEN len;
@@ -1901,7 +1903,7 @@
if (type != SVt_PVAV && type != SVt_PVHV && type != SVt_PVFM) {
/* the essential of pp_stringify */
#if PERL_VERSION > 7
- pv = newSVpvs("");
+ pv = sv_2mortal (newSVpvs(""));
if (!isref && !(enc->json.flags & F_ALLOW_STRINGIFY)) {
sv_copypv(pv, sv_2mortal (newRV_inc (sv)));
} else {
@@ -1915,10 +1917,10 @@
pv = AMG_CALLun(sv,string);
len = SvCUR(pv);
str = SvPVX(pv);
- SvREFCNT_inc(pv);
+ sv_2mortal (SvREFCNT_inc(pv));
}
else {
- pv = newSVpvs("");
+ pv = sv_2mortal (newSVpvs(""));
s = SvPV(sv,len);
sv_setpvn(pv,s,len);
if (SvUTF8(sv))
@@ -1931,7 +1933,7 @@
#endif
if (!len && !SvOBJECT (sv)) {
encode_const_str (aTHX_ enc, "null", 4, 0);
- SvREFCNT_dec(pv);
+ /* pv is mortal */
return;
}
} else {
@@ -1939,7 +1941,7 @@
if (SvGMAGICAL(sv))
mg_get(sv);
if (MyAMG(sv)) { /* force a RV here */
- SV* rv = newRV_inc(sv);
+ SV* rv = sv_2mortal (newRV_inc(sv));
#if PERL_VERSION <= 8
HV *stash = SvSTASH(sv);
if (!SvSTASH(rv) || !(SvFLAGS(sv) & SVf_AMAGIC)) {
@@ -1967,10 +1969,9 @@
encode_ch (aTHX_ enc, '"');
encode_str (aTHX_ enc, str, len, 1);
encode_ch (aTHX_ enc, '"');
- SvREFCNT_dec(rv);
+ /* rv is mortal */
return;
}
- SvREFCNT_dec(rv);
pv = NULL; /* owned by the overload call */
}
}
@@ -1984,23 +1985,23 @@
(enc->json.flags & F_ALLOW_BIGNUM)
&& str
&& SvROK(sv)
- && (memEQc(str, "NaN") || memEQc(str, "nan") ||
- memEQc(str, "inf") || memEQc(str, "-inf"))))
+ && (strPrefixc(str, "NaN") || strPrefixc(str, "nan") ||
+ strPrefixc(str, "inf") || strPrefixc(str, "-inf"))))
{
if (is_bignum_obj (aTHX_ SvRV (sv)))
{
if (enc->json.infnan_mode == 0) {
encode_const_str (aTHX_ enc, "null", 4, 0);
- if (pv) SvREFCNT_dec(pv);
+ /* pv is mortal */
return;
} else if (enc->json.infnan_mode == 3) {
- if (memEQc(str, "NaN") || memEQc(str, "nan"))
+ if (strPrefixc(str, "NaN") || strPrefixc(str, "nan"))
encode_const_str (aTHX_ enc, "nan", 3, 0);
- else if (memEQc(str, "inf"))
+ else if (strPrefixc(str, "inf"))
encode_const_str (aTHX_ enc, "inf", 3, 0);
else
encode_const_str (aTHX_ enc, "-inf", 4, 0);
- if (pv) SvREFCNT_dec(pv);
+ /* pv is mortal */
return;
}
}
@@ -2014,10 +2015,20 @@
if (isref != 1)
encode_ch (aTHX_ enc, '"');
}
- if (pv) SvREFCNT_dec(pv);
+ /* pv and rv are mortal: freed by encode_stringify's scope, also when
encode_str croaks */
#undef MyAMG
}
+/* The temporaries of encode_stringify_ (string copy, overload object) are
+ freed on return and when encode_str croaks (malformed UTF-8). */
+static void
+encode_stringify(pTHX_ enc_t *enc, SV *sv, int isref)
+{
+ ENTER; SAVETMPS;
+ encode_stringify_(aTHX_ enc, sv, isref);
+ FREETMPS; LEAVE;
+}
+
INLINE int
encode_bool_obj (pTHX_ enc_t *enc, SV *sv, int force_conversion, int as_string)
{
@@ -2517,17 +2528,17 @@
str++;
len--;
}
- if (UNLIKELY (memEQc (str, "NaN") || memEQc (str, "nan")))
+ if (UNLIKELY (strPrefixc (str, "NaN") || strPrefixc (str, "nan")))
{
nv = NV_NAN;
is_bigobj = 0;
}
- else if (UNLIKELY (memEQc (str, "inf")))
+ else if (UNLIKELY (strPrefixc (str, "inf")))
{
nv = NV_INF;
is_bigobj = 0;
}
- else if (UNLIKELY (memEQc (str, "-inf")))
+ else if (UNLIKELY (strPrefixc (str, "-inf")))
{
nv = -NV_INF;
is_bigobj = 0;
@@ -2982,7 +2993,7 @@
{
is_neg = 1;
if (LIKELY(uv <= (UV)(IV_MAX) + 1))
- iv = -(IV)uv;
+ iv = (IV)(0 - uv); /* unsigned negate: uv may be IV_MAX +
1 */
else
{
iv = IV_MIN; /* underflow, but F_ALLOW_BIGNUM can handle
this */
@@ -4369,7 +4380,7 @@
AV *av = newAV ();
AV *typeav = NULL;
SV *typerv;
- int hooked = (dec->json.flags & F_HOOK) != 0;
+ int hooked = (dec->json.flags & (F_HOOK | F_ALLOW_TAGS)) != 0;
/* a croaking filter callback would leak this container, which is only
referenced from the C stack; hold a mortal reference while hooks can run
*/
if (UNLIKELY (hooked))
@@ -4480,7 +4491,7 @@
int dupkeys_as_arrayref = dec->json.flags & F_DUPKEYS_AS_AREF;
HV *dupkeys_seen = NULL;
char endstr = '"';
- int hooked = (dec->json.flags & F_HOOK) != 0;
+ int hooked = (dec->json.flags & (F_HOOK | F_ALLOW_TAGS)) != 0;
if (UNLIKELY (hooked))
sv_2mortal ((SV *)hv);
@@ -4589,10 +4600,15 @@
(void)hv_store_ent (typehv, keysv, value_typesv, 0);
}
+ /* a croaking filter or THAW would leak keysv: the mortal
owns it */
+ if (UNLIKELY (hooked))
+ sv_2mortal (keysv);
+
value = decode_sv (aTHX_ dec, value_typesv);
if (!value)
{
- SvREFCNT_dec (keysv);
+ if (!hooked)
+ SvREFCNT_dec (keysv);
goto fail;
}
@@ -4602,7 +4618,8 @@
|| SvTYPE (SvRV (old_value)) != SVt_PVAV))
{
SvREFCNT_dec (value);
- SvREFCNT_dec (keysv);
+ if (!hooked)
+ SvREFCNT_dec (keysv);
ERR ("Invalid dupkeys_as_arrayref hash key");
}
av_push ((AV*)SvRV (old_value), value);
@@ -4612,7 +4629,8 @@
{
(void)hv_store_ent (hv, keysv, value, 0);
}
- SvREFCNT_dec (keysv);
+ if (!hooked)
+ SvREFCNT_dec (keysv);
break;
}
@@ -5037,7 +5055,7 @@
LEAVE;
ENTER;
PUSHMARK(SP);
- XPUSHs(newSVpvn(encoding, strlen(encoding)));
+ XPUSHs(sv_2mortal (newSVpvn(encoding, strlen(encoding))));
XPUSHs(string);
PUTBACK;
/* Calling Encode::Unicode::decode_xs would be faster, but we'd need the
blessed
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Cpanel-JSON-XS-4.82/t/129_stringify_leak.t
new/Cpanel-JSON-XS-4.83/t/129_stringify_leak.t
--- old/Cpanel-JSON-XS-4.82/t/129_stringify_leak.t 2026-10-14
15:56:24.000000000 +0200
+++ new/Cpanel-JSON-XS-4.83/t/129_stringify_leak.t 2026-11-23
09:47:44.000000000 +0100
@@ -1,5 +1,7 @@
use strict;
-use Test::More tests => 2;
+use Config;
+use Test::More tests => 5;
+use Encode ();
use Cpanel::JSON::XS;
@@ -13,3 +15,38 @@
is( $freed, 1, 'hash object' );
{ my $s = 'x'; Cpanel::JSON::XS->new->convert_blessed->encode([ bless \$s,
'Str' ]) }
is( $freed, 2, 'scalar object' );
+
+
+# encode_str croaks on malformed UTF-8: nothing may leak.
+# A truncated sequence with the UTF8 flag forced on is malformed on every perl.
+sub malformed {
+ my $s = "\xe2\x98\xba\x20\xe2\x98";
+ Encode::_utf8_on($s);
+ return $s;
+}
+{
+ package Bad;
+ use overload '""' => sub { main::malformed() }, fallback => 1;
+ sub DESTROY { $freed++ }
+}
+$freed = 0;
+eval { Cpanel::JSON::XS->new->convert_blessed->encode([ bless {}, 'Bad' ]) };
+ok( $@, 'croaks on malformed UTF-8' );
+is( $freed, 1, 'overloaded object freed after croak' );
+
+SKIP: {
+ skip "RSS is not meaningful under a sanitizer", 1 if $Config{ccflags} =~
/-fsanitize/;
+ skip "RSS is read from /proc/self/status on Linux only", 1 unless $^O eq
'linux';
+ open my $f, '<', '/proc/self/status' or skip "no /proc/self/status", 1;
+ my $rss = sub { seek $f, 0, 0; while (<$f>) { return $1 if /^VmRSS:\s+(\d+)/
} };
+ defined $rss->() or skip "no VmRSS in /proc/self/status", 1;
+ my $enc = Cpanel::JSON::XS->new->allow_stringify;
+ my $one = sub {
+ my $s = malformed();
+ eval { $enc->encode([\$s]) };
+ };
+ for (1 .. 20_000) { $one->() }
+ my $r0 = $rss->();
+ for (1 .. 200_000) { $one->() }
+ cmp_ok( $rss->() - $r0, '<', 4000, 'allow_stringify croak: no string copy
leak' );
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Cpanel-JSON-XS-4.82/t/130_thaw_croak_leak.t
new/Cpanel-JSON-XS-4.83/t/130_thaw_croak_leak.t
--- old/Cpanel-JSON-XS-4.82/t/130_thaw_croak_leak.t 2026-10-14
15:56:24.000000000 +0200
+++ new/Cpanel-JSON-XS-4.83/t/130_thaw_croak_leak.t 2026-11-23
09:47:44.000000000 +0100
@@ -1,5 +1,5 @@
use strict;
-use Test::More tests => 1;
+use Test::More tests => 4;
use Cpanel::JSON::XS;
@@ -11,3 +11,14 @@
->filter_json_single_key_object(m => sub { bless {}, 'Marker' });
eval { $json->decode('("Rejects")[{"m":1}]') };
is( $freed, 1, "Properly freed" );
+
+# THAW dies inside an array/object: the enclosing containers are freed
+sub Ok::THAW { my ($class, $fmt, @v) = @_; bless [@v], $class }
+sub Ok::DESTROY { $freed++ }
+$json = Cpanel::JSON::XS->new->allow_tags;
+for my $text ('[("Ok")[],("Rejects")[]]', '{"k":("Ok")[],"t":("Rejects")[]}',
+ '[[("Ok")[]],("Rejects")[]]') {
+ $freed = 0;
+ eval { $json->decode($text) };
+ is( $freed, 1, "enclosing containers freed: $text" );
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Cpanel-JSON-XS-4.82/t/131_filter_self_removal.t
new/Cpanel-JSON-XS-4.83/t/131_filter_self_removal.t
--- old/Cpanel-JSON-XS-4.82/t/131_filter_self_removal.t 2026-11-16
13:28:23.000000000 +0100
+++ new/Cpanel-JSON-XS-4.83/t/131_filter_self_removal.t 2026-11-23
09:47:44.000000000 +0100
@@ -1,5 +1,6 @@
use strict;
-use Test::More tests => 2;
+use Config;
+use Test::More tests => 3;
use Cpanel::JSON::XS;
@@ -18,3 +19,19 @@
# a dying callback frees the enclosing containers (no leak); the error
propagates
eval { Cpanel::JSON::XS->new->filter_json_object(sub { die "cb\n"
})->decode('[[{"a":1}]]') };
is( $@, "cb\n", "dying filter callback propagates" );
+
+# a dying filter callback frees the keys of the enclosing objects
+SKIP: {
+ skip "RSS is not meaningful under a sanitizer", 1 if $Config{ccflags} =~
/-fsanitize/;
+ skip "RSS is read from /proc/self/status on Linux only", 1 unless $^O eq
'linux';
+ open my $f, '<', '/proc/self/status' or skip "no /proc/self/status", 1;
+ my $rss = sub { seek $f, 0, 0; while (<$f>) { return $1 if /^VmRSS:\s+(\d+)/
} };
+ defined $rss->() or skip "no VmRSS in /proc/self/status", 1;
+ my $dec = Cpanel::JSON::XS->new->allow_singlequote
+ ->filter_json_object(sub { die "obj_cb\n" });
+ my $text = '{"a":{"b":{"c":{}}}}';
+ for (1 .. 20_000) { eval { $dec->decode($text) } }
+ my $r0 = $rss->();
+ for (1 .. 200_000) { eval { $dec->decode($text) } }
+ cmp_ok( $rss->() - $r0, '<', 4000, 'filter_json_object die: no key leak' );
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Cpanel-JSON-XS-4.82/t/31_bom.t
new/Cpanel-JSON-XS-4.83/t/31_bom.t
--- old/Cpanel-JSON-XS-4.82/t/31_bom.t 2026-09-17 11:25:38.000000000 +0200
+++ new/Cpanel-JSON-XS-4.83/t/31_bom.t 2026-11-23 09:47:44.000000000 +0100
@@ -2,7 +2,8 @@
#
# https://tools.ietf.org/html/rfc7159#section-8.1
# JSON text SHALL be encoded in UTF-8, UTF-16, or UTF-32.
-use Test::More ($] >= 5.008) ? (tests => 9 + 6) : (skip_all => "needs 5.8");;
+use Test::More ($] >= 5.008) ? (tests => 9 + 6 + 1) : (skip_all => "needs
5.8");;
+use Config;
use Cpanel::JSON::XS;
use Encode; # Currently required for <5.20
use charnames qw(:short);
@@ -88,3 +89,18 @@
'("BomFilterCorruption::Thaw")[]',
sub { $_[0]->allow_tags (1) },
);
+
+# a BOM decode leaks nothing
+SKIP: {
+ skip "RSS is not meaningful under a sanitizer", 1 if $Config{ccflags} =~
/-fsanitize/;
+ skip "RSS is read from /proc/self/status on Linux only", 1 unless $^O eq
'linux';
+ open my $f, '<', '/proc/self/status' or skip "no /proc/self/status", 1;
+ my $rss = sub { seek $f, 0, 0; while (<$f>) { return $1 if /^VmRSS:\s+(\d+)/
} };
+ defined $rss->() or skip "no VmRSS in /proc/self/status", 1;
+ my $dec = Cpanel::JSON::XS->new;
+ my $bom = "\xfe\xff\0[\0001\0]";
+ for (1 .. 20_000) { $dec->decode($bom) }
+ my $r0 = $rss->();
+ for (1 .. 200_000) { $dec->decode($bom) }
+ cmp_ok( $rss->() - $r0, '<', 4000, 'UTF-16 BOM decode: no leak' );
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Cpanel-JSON-XS-4.82/t/_unicode_handling.pm
new/Cpanel-JSON-XS-4.83/t/_unicode_handling.pm
--- old/Cpanel-JSON-XS-4.82/t/_unicode_handling.pm 2026-11-16
13:28:23.000000000 +0100
+++ new/Cpanel-JSON-XS-4.83/t/_unicode_handling.pm 2026-11-23
09:47:44.000000000 +0100
@@ -2,7 +2,7 @@
package
_unicode_handling;
-our $VERSION = '4.82';
+our $VERSION = '4.83';
# this is a dummy pragma for 5.005.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Cpanel-JSON-XS-4.82/utf8_range.c
new/Cpanel-JSON-XS-4.83/utf8_range.c
--- old/Cpanel-JSON-XS-4.82/utf8_range.c 2026-09-28 10:34:52.000000000
+0200
+++ new/Cpanel-JSON-XS-4.83/utf8_range.c 2026-11-23 09:47:44.000000000
+0100
@@ -284,14 +284,14 @@
/* Overlaps lead to index 9~15, which are illegal in range table */
/* shift1 = (input, prev_input) << 1 byte */
shift1 = _mm_alignr_epi8(input, prev_input, 15);
- pos = _mm_sub_epi8(shift1, _mm_set1_epi8(0xEF));
+ pos = _mm_sub_epi8(shift1, _mm_set1_epi8((char)0xEF));
/*
* shift1: | EF F0 ... FE | FF 00 ... ... DE | DF E0 ... EE |
* pos: | 0 1 15 | 16 17 239| 240 241 255|
* pos-240: | 0 0 0 | 0 0 0 | 0 1 15 |
* pos+112: | 112 113 127| >= 128 | >= 128 |
*/
- tmp = _mm_subs_epu8(pos, _mm_set1_epi8(0xF0));
+ tmp = _mm_subs_epu8(pos, _mm_set1_epi8((char)0xF0));
range2 = _mm_shuffle_epi8(df_ee_tbl, tmp);
tmp = _mm_adds_epu8(pos, _mm_set1_epi8(0x70));
range2 = _mm_add_epi8(range2, _mm_shuffle_epi8(ef_fe_tbl, tmp));
@@ -555,14 +555,14 @@
/* Overlaps lead to index 9~15, which are illegal in range table */
/* shift1 = (input, prev_input) << 1 byte */
shift1 = push_last_byte_of_a_to_b(prev_input, input);
- pos = _mm256_sub_epi8(shift1, _mm256_set1_epi8(0xEF));
+ pos = _mm256_sub_epi8(shift1, _mm256_set1_epi8((char)0xEF));
/*
* shift1: | EF F0 ... FE | FF 00 ... ... DE | DF E0 ... EE |
* pos: | 0 1 15 | 16 17 239| 240 241 255|
* pos-240: | 0 0 0 | 0 0 0 | 0 1 15 |
* pos+112: | 112 113 127| >= 128 | >= 128 |
*/
- tmp1 = _mm256_subs_epu8(pos, _mm256_set1_epi8(240));
+ tmp1 = _mm256_subs_epu8(pos, _mm256_set1_epi8((char)0xF0));
range2 = _mm256_shuffle_epi8(df_ee_tbl, tmp1);
tmp2 = _mm256_adds_epu8(pos, _mm256_set1_epi8(112));
range2 = _mm256_add_epi8(range2, _mm256_shuffle_epi8(ef_fe_tbl,
tmp2));
++++++ _scmsync.obsinfo ++++++
--- /var/tmp/diff_new_pack.QHJ4Pw/_old 2026-11-27 19:44:28.700488359 +0100
+++ /var/tmp/diff_new_pack.QHJ4Pw/_new 2026-11-27 19:44:28.710488782 +0100
@@ -1,6 +1,6 @@
-mtime: 1795005227
-commit: 6e36dcb483fd7dceda75f557827125ac8766e8a77c71331067d967a08de4e2e2
+mtime: 1795449742
+commit: fe4fc34835f57611d1ef25996ecd7d345a9abf1ae522a32b49e0db3bffbeec42
url: https://src.opensuse.org/perl/perl-Cpanel-JSON-XS
-revision: 6e36dcb483fd7dceda75f557827125ac8766e8a77c71331067d967a08de4e2e2
+revision: fe4fc34835f57611d1ef25996ecd7d345a9abf1ae522a32b49e0db3bffbeec42
projectscmsync: https://src.opensuse.org/perl/_ObsPrj
++++++ build.specials.obscpio ++++++
++++++ build.specials.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/.gitignore new/.gitignore
--- old/.gitignore 1970-01-01 01:00:00.000000000 +0100
+++ new/.gitignore 2026-11-23 17:02:22.000000000 +0100
@@ -0,0 +1 @@
+.osc