Package: release.debian.org Severity: normal Tags: trixie User: [email protected] Usertags: pu X-Debbugs-Cc: Debian Ruby <[email protected]>, [email protected] Control: affects -1 + src:ruby-crack
[ Reason ]
ruby-crack 0.4.4-4+deb13u1 restores the empty hash that Crack::XML.parse used to return for a blank
document. REXML 3.4, as shipped in Ruby 3.3.14-0+deb13u1 from trixie-security, rejects a document
that has no root element. Crack::XML.parse("") and Crack::XML.parse(" ") used
to return {}, and the suite still expects that. On this Ruby those two tests raise
REXML::ParseException (#1154599).
The guard is the one from crack 1.0.1, commit
3eb3c7096431b79fd81b93cd9cae554ddea03123, already in Sid as ruby-crack 1.0.1-1.
Santiago Vila marked the bug fixed in that version.
[ Impact ]
The package fails to build against the Ruby already in trixie-security. A
caller that parses a blank XML body gets an exception instead of an empty hash.
The single-space case is the empty response the unfuddle XML API returns when
creating an object.
[ Tests ]
I built the package and ran autopkgtest in a Trixie chroot with trixie,
trixie-updates, trixie-security, and trixie-proposed-updates. The chroot
installed Ruby 3.3.14-0+deb13u1. The suite is 92 runs, 162 assertions, 0
failures, 0 errors, and 0 skips. autopkgtest gem2deb-test-runner passed, and
that run includes the empty-string test and the single-space test.
[ Risks ]
The patch is the upstream change. A string that is empty after strip returns {}
before REXML sees it. Any other document is parsed as before.
[ Checklist ]
[x] *all* changes are documented in the d/changelog
[x] I reviewed all changes and I approve them
[x] attach debdiff against the package in stable
[x] the issue is verified as fixed in unstable
[ Changes ]
The debdiff adds debian/patches/blank-xml-is-empty-hash.patch, from
https://github.com/jnunemaker/crack/commit/3eb3c7096431b79fd81b93cd9cae554ddea03123
(crack 1.0.1).
Best regards,
Simon Quigley
[email protected]
diff -Nru ruby-crack-0.4.4/debian/changelog ruby-crack-0.4.4/debian/changelog --- ruby-crack-0.4.4/debian/changelog 2022-12-12 19:10:46.000000000 -0600 +++ ruby-crack-0.4.4/debian/changelog 2026-11-21 11:34:09.000000000 -0600 @@ -1,3 +1,10 @@ +ruby-crack (0.4.4-4+deb13u1) trixie; urgency=medium + + * Team upload. + * Treat a blank XML document as an empty hash (Closes: #1154599). + + -- Simon Quigley <[email protected]> Sat, 21 Nov 2026 11:34:09 -0600 + ruby-crack (0.4.4-4) unstable; urgency=medium * Team upload diff -Nru ruby-crack-0.4.4/debian/patches/blank-xml-is-empty-hash.patch ruby-crack-0.4.4/debian/patches/blank-xml-is-empty-hash.patch --- ruby-crack-0.4.4/debian/patches/blank-xml-is-empty-hash.patch 1969-12-31 18:00:00.000000000 -0600 +++ ruby-crack-0.4.4/debian/patches/blank-xml-is-empty-hash.patch 2026-11-21 11:33:53.000000000 -0600 @@ -0,0 +1,22 @@ +Description: Treat a blank XML document as an empty hash + REXML 3.4 rejects a document that has no root element. A blank string + used to parse as an empty hash, and the suite still expects that. +Author: Zsolt Kozaroczy <[email protected]> +Origin: upstream, https://github.com/jnunemaker/crack/commit/3eb3c7096431b79fd81b93cd9cae554ddea03123 +Bug: https://github.com/jnunemaker/crack/issues/84 +Bug-Debian: https://bugs.debian.org/1154599 +Applied-Upstream: 1.0.1 +Forwarded: not-needed +Last-Update: 2026-11-21 +--- +--- a/lib/crack/xml.rb ++++ b/lib/crack/xml.rb +@@ -232,6 +232,8 @@ + end + + def self.parse(xml) ++ return {} if xml.strip == '' ++ + parser.parse(xml) + end + end diff -Nru ruby-crack-0.4.4/debian/patches/series ruby-crack-0.4.4/debian/patches/series --- ruby-crack-0.4.4/debian/patches/series 2022-12-12 19:10:46.000000000 -0600 +++ ruby-crack-0.4.4/debian/patches/series 2026-11-21 11:33:53.000000000 -0600 @@ -1,2 +1,3 @@ don't_relly_on_git.patch 0001-Use-named-parameters-for-safe_load.patch +blank-xml-is-empty-hash.patch
OpenPGP_signature.asc
Description: OpenPGP digital signature

