[Koha-bugs] [Bug 27365] New: Koha doesn't check marcxml field size is < 10000 and fails in various places

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jan 8 16:19:29 CET 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27365

            Bug ID: 27365
           Summary: Koha doesn't check marcxml field size is < 10000 and
                    fails in various places
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: MARC Bibliographic data support
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: didier.gautheron at biblibre.com
        QA Contact: testopia at bugs.koha-community.org

Hi

ISO standard
>The core of the framework is a MARCXML schema that allows lossless round-trip >conversion of an ISO 2709 MARC 21 record and an XML-encoded MARC 21 record.

Thus a field size is 9999 bytes max.

But  /usr/share/perl5/MARC/File/USMARC.pm doesn't care:

my $direntry = sprintf( "%03s%04d%05d", $field->tag, $len, $dataend );

and if len >= 10000 it silently creates a bogus directory with a length of 13
rather then 12.

These non-conformed marxml will fail in various places. Export, search results
list with elasticsearch which store  ISO 2709 record in index and use them as
data source in results list.


eg:
Easy to trigger in french UNIMARC with 359 (sorry in french)
https://www.transition-bibliographique.fr/wp-content/uploads/2019/02/B359-2002.pdf

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list