You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an issue with plist files that macOS keeps in Preferences folder, and after some debugging I found that decoder does not respect possibility of the floating point number to be 4 bytes long.
The length of the byte slice there is 4 bytes, but binary.Read expects 8 bytes for float64 type.
This can probably be fixed with byte length check and with float32 type in case the length is 4. Then, it can be safely converted to float64 for internal use.
I noticed that converting problematic files to xml and back to binary solves the issue: plist encodes new binary files with float64 bytes, however, this is not a suitable workaround for me.
The text was updated successfully, but these errors were encountered:
I have an issue with
plist
files that macOS keeps in Preferences folder, and after some debugging I found that decoder does not respect possibility of the floating point number to be 4 bytes long.What I get:
unexpected EOF
returned byparseReal
, specifically from this line: https://github.com/groob/plist/blob/63fa881b19a57babfe576f2750f5dc3b29ebb69f/binary_parser.go#L257The length of the byte slice there is 4 bytes, but
binary.Read
expects 8 bytes forfloat64
type.This can probably be fixed with byte length check and with
float32
type in case the length is 4. Then, it can be safely converted to float64 for internal use.I noticed that converting problematic files to xml and back to binary solves the issue:
plist
encodes new binary files with float64 bytes, however, this is not a suitable workaround for me.The text was updated successfully, but these errors were encountered: