flatpak / xdg-dbus-proxy

GNU Lesser General Public License v2.1
53 stars 21 forks source link

flatpak-proxy: Fix D-Bus disconnection with overly long object paths #50

Closed hadess closed 11 months ago

hadess commented 1 year ago

According to the D-Bus specifications: https://dbus.freedesktop.org/doc/dbus-specification.html#id-1.4.4

For the STRING and OBJECT_PATH types, [the data length] is encoded in 4 bytes (a UINT32).

But the code was trying to parse the 32-bit integer as an 8-bit one, meaning that, as was the case with object paths created by the dLeyna project, a 259-byte long string would be parsed like a 3-byte long one.

hadess commented 1 year ago

CC @phako

hadess commented 1 year ago

Looks like an oversight introduced when this function was added back in 2015 (004b7b2ca0e95d34a302c3b5c75ffd86ed64dd6b in flatpak). I'm no D-Bus internals expert, but i can't see why this change wouldn't be correct.

I've added a reference to that commit, thanks!

matthiasclasen commented 1 year ago

Nice catch. The fix looks correct to me as well