Skip to content

fix(program-log): avoid panic on invalid UTF-8 in host logger - #885

Open
raushan728 wants to merge 2 commits into
anza-xyz:masterfrom
raushan728:fix/host-utf8-panic
Open

fix(program-log): avoid panic on invalid UTF-8 in host logger#885
raushan728 wants to merge 2 commits into
anza-xyz:masterfrom
raushan728:fix/host-utf8-panic

Conversation

@raushan728

Copy link
Copy Markdown
Contributor

The host std logging path unconditionally called from_utf8(message).unwrap(), panicking on non-UTF-8 byte buffers, while the on-chain path passes raw bytes to sol_log_ with no validation causing a host-only crash for callers that log byte buffers rather than str. Switched the host path to String::from_utf8_lossy.

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.

1 participant