guelfey / go.dbus

Native Go bindings for D-Bus
BSD 2-Clause "Simplified" License
124 stars 42 forks source link

Fix encoding alignment logic. #56

Open vincenospam opened 9 years ago

vincenospam commented 9 years ago

The newEncoder method is recursive, but alignment logic must be based on "global" absolute position. This FIX allows recursive calls to set the initial position.

Unit tests added to verify the problem and fix.

The problem was discovered for nested containers where the start of the nested container can be on a 4-byte-aligned (but not 8-byte-aligned) boundary.