Closed aconverse closed 2 years ago
Thanks for the report! You mean https://github.com/LibVNC/libvncserver/commit/26bf37494a8ca5deaaa79d74cdda2da3af318e06#diff-682a84ead83abbcefd0862a81a8331d6017009c2fb339e7475063321f25d1b7dR298-R300 ? Yes, that seems to have slipped under the radar, thanks for spotting! Do you want to create a PR fixing this?
If you'd like to put out an incentive for fixing this bug, you can do so at https://issuehunt.io/r/LibVNC/libvncserver
Describe the bug Please disregard this bug if the current code in the master branch (and the next release whenever that may be) is not intended to be ABI compatible with the 0.9.13 release. This would imply that linux distros cannot update libvncserver without rebuilding all consuming applications and is often accompanied with a soname bump.
It appears that 26bf37494a8ca5deaaa79d74cdda2da3af318e06 #468 adds a struct member
setXCutTextUTF8
in the middle ofstruct _rfbScreenInfo
. This causes computed offsets of all subsequent members to be shifted bysizeof(void*)
. This causes calling code to not have the same understanding of struct offsets and load the wrong values from memory for these fields.To Reproduce
newClientHook
.newClientHook
is called.This can be observed with in less integrated ways with the
offsetof(rfbScreenInfo, newClientHook)
and withpahole -C _rfbScreenInfo /path/to/libvncserver.so.0.9.13
when built with debug info.Expected Behavior The program still works / pahole struct representations are compatible
Logs/Backtraces Attached is a diff of
pahole -C _rfbScreenInfo /path/to/libvncserver.so.0.9.13
with the release and master.libvnserver._rfbScreenInfo.diff.txt
Your environment (please complete the following information):
Additional context The most straightforward workaround would be to move the new field to the end of the struct.