]> git.koha-community.org Git - koha.git/commit
Bug 38913: (QA follow-up) test UTF-8 exceptions in large MARC records
authorDavid Cook <dcook@prosentient.com.au>
Mon, 20 Jan 2025 02:55:12 +0000 (02:55 +0000)
committerAlex Buckley <alexbuckley@catalyst.net.nz>
Thu, 20 Feb 2025 03:21:05 +0000 (03:21 +0000)
commit2e0dafcde5436966866ca028a0a4d614285e5488
treebeef7edd5fec96f1f01f2c193573f266cf52532d
parent041e4368f9ebe12a14480babeec62ec543f072d5
Bug 38913: (QA follow-up) test UTF-8 exceptions in large MARC records

MARC records with over 99999 bytes are invalid by spec, and when you use
UTF-8 encoded characters in your MARC records, there is the potential
to generate fatal errors in MARC::File::USMARC when it runs
"marc_to_utf8" from "MARC::File::Encode" during its "decode" operation.

That is, if you MARC::File::USMARC->encode a MARC record
with over 99999 bytes (including a number of UTF-8 bytes), there
is the potential when you run MARC::File:USMARC->decode on that same
data that you'll generate a fatal exception.

The main patch in bug 38913 wraps the function doing the decode,
so that a bad record doesn't crash processing.

Without the patch, this unit test will fail. With the patch, this
unit test will pass.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9d41abc1e77c15ee88f66ba7aa0b419524760293)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
t/db_dependent/Koha/SearchEngine/Elasticsearch.t