Closed ghost closed 3 years ago
Thanks for reporting this, good catch. I pushed commit 501f8c8 that should prevent the heap overflow, and also improves the buffer reallocation.
Just ran the new commit through ~8000 profiles, seems to be fine now. :)
This was where it overflowed for me: https://github.com/libimobiledevice/libplist/blob/ced16994f3787853bb74f8ec3baa7f2338292340/tools/plistutil.c#L188
But the reallocation was also pretty inefficient, once the BUF_SIZE was reached it would reallocate with +1 byte every time it reads another byte from STDIN, so I changed it to start with 4k and realloc +4k when needed.
plistutil seems to be buggy when reading from standard input and converting between XML and binary formats.