Skip to content

Fix internal TurboJPEG symbol visibility leak in shared library - #740

Open
M3ML1NE wants to merge 1 commit into
LibVNC:masterfrom
M3ML1NE:fix/auto-bounty-729-issue729
Open

M3ML1NE wants to merge 1 commit into
LibVNC:masterfrom
M3ML1NE:fix/auto-bounty-729-issue729

Conversation

@M3ML1NE

@M3ML1NE M3ML1NE commented Aug 11, 2026

Copy link
Copy Markdown

Fixes #729

Summary of Changes

When building libvncserver.so, internal bundled TurboJPEG functions (tjCompress, tjCompress2, tjInitCompress, etc.) were exported into the global symbol table because DLLEXPORT in src/common/turbojpeg.h defaulted to empty (public export) on GCC/Clang ELF systems.

This PR updates DLLEXPORT macro definition in src/common/turbojpeg.h to set __attribute__ ((visibility ("hidden"))) when compiling with GCC/Clang (version >= 4), ensuring bundled TurboJPEG functions remain private to libvncserver and do not override global symbols when applications link against both libvncserver and system libjpeg-turbo.

Added automated runtime symbol visibility test check in test/cargstest.c via dlsym to prevent regressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exports conflicting turbojpeg functions

1 participant