Skip to content

Error parsing some seemingly valid binary plists (illegal integer size) #77

@MarSoft

Description

@MarSoft

First of all, I'm not sure if this error is in go-plist or in libplist.

The error is:
plist: error parsing binary property list: illegal integer size
Here is my minimal reproducing testing code:

package main

import "fmt"
import "os"
import "howett.net/plist"

func main() {
    dat, _ := os.ReadFile("t4.plist")
    var x [][]byte
    typ, err := plist.Unmarshal(dat, &x)
    fmt.Println(x, typ, err)
}

Output: [] 0 plist: error parsing binary property list: illegal integer size
Here is gzipped input file reproducing the problem: t4.plist.gz
It's just a plist consisting of an array element as its top-level structure, with just a single member which is a data object with length of 65523 bytes or more (its contents does not matter).
Here's the same plist in XML form, generated with plistutil from https://github.com/libimobiledevice/libplist version 2.2.0: t4.xml.gz

And here's a binary plist with the same data & structure but generated using go-plist:
t5.plist.gz

Even if the actual bug is in libplist, there are still some binary plists in the wild which were generated with it. And libplist handles both t4.plist and t5.plist without a question, but go-plist fails with t4.plist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions