Skip to content

Fix issue accessing uninitialized memory in zrle.c#685

Open
mtrea wants to merge 1 commit into
LibVNC:masterfrom
mtrea:master
Open

Fix issue accessing uninitialized memory in zrle.c#685
mtrea wants to merge 1 commit into
LibVNC:masterfrom
mtrea:master

Conversation

@mtrea

@mtrea mtrea commented Jan 2, 2026

Copy link
Copy Markdown

This replaces pointer casting in UncompressCPixel with memcpy to prevent reading uninitialized memory when REALBPP/8 is smaller than sizeof(CARDBPP). For example, this is important if REALBPP/8 was 3 bytes but sizeof(CARDBPP) was 4 bytes.

I detected this issue and verified this fix with the help of https://github.com/google/sanitizers/wiki/memorysanitizer.

This replaces pointer casting in UncompressCPixel with memcpy to prevent reading uninitialized memory when REALBPP/8 is smaller than sizeof(CARDBPP). For example, this is important if REALBPP/8 was 3 bytes but sizeof(CARDBPP) was 4 bytes.
@bk138

bk138 commented Mar 14, 2026

Copy link
Copy Markdown
Member

Does not pass CI, please rebuild.

@mtrea

mtrea commented Mar 16, 2026

Copy link
Copy Markdown
Author

How can I do that? I'm having a little trouble figuring that out.

@bk138

bk138 commented Mar 16, 2026

Copy link
Copy Markdown
Member

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants