Skip to content

Segmentation fault when Linux plutil tries to convert a single non-ascii string of sufficiently long size to binary plist. #5284

@nglevin

Description

@nglevin

Found when comparing the output of the Linux plutil against the macOS plutil...

I have an old-style OpenSTEP plist with some very long strings. For the purposes of reproducing the problem for this issue, I'm using this string that has one repeating, non-ascii character in it...

"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" = "ФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФ";

Save that as old-strings-with-non-ascii-character.strings (alas, GitHub will not let me attach a ".strings" suffixed file).

On macOS, if I do the following:
plutil -convert binary1 -o - old-strings-with-non-ascii-character.strings

...I get the binary plist version printed out to stdout, as expected.

But with the Linux version of plutil found in swift-corelibs-foundation...
plutil -convert binary1 -o - old-strings-with-non-ascii-character.strings

...I get the following crash.
Segmentation fault (core dumped)

Interestingly, the XML converter is fine; only the binary plist converter on Linux has a problem with this string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions