Skip to content

toUtf8String remove null bytes #3694

Answered by ricmoo
alexbakers asked this question in Q&A
Discussion options

You must be logged in to vote

Your string contains null termination characters. A file name cannot contain either null-termination or slash characters.

If you are using a Bytes32 string, you should use the parseBytes32String function, which expects a null terminated string. But you should investigate where the source of the string is coming from, because code like that is dangerous and may be subject to arbitrary coded execution or other ACE concerns.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ricmoo
Comment options

Answer selected by alexbakers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #3693 on January 28, 2023 17:14.