]> 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)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Fri, 24 Jan 2025 11:02:14 +0000 (12:02 +0100)
commit9d41abc1e77c15ee88f66ba7aa0b419524760293
tree0139fa68f4bf28c264d06cc6ff8fe052cab30df8
parentc7127fabf4ebe736a3563df4bd3e500691d0b632
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>
t/db_dependent/Koha/SearchEngine/Elasticsearch.t