Skip to content

Fix: Model::try_set_option: Return error if option name contains NUL char#41

Merged
lovasoa merged 1 commit into
rust-or:mainfrom
alexdewar:return-err-nul-char-try_set_option
May 2, 2026
Merged

Fix: Model::try_set_option: Return error if option name contains NUL char#41
lovasoa merged 1 commit into
rust-or:mainfrom
alexdewar:return-err-nul-char-try_set_option

Conversation

@alexdewar

Copy link
Copy Markdown
Contributor

This is just a small follow-on to #40.

Currently Model::try_set_option panics in the case that there is a NUL char in the option name, but there's no reason really to treat these bad option names as different from any other. Return an error in this case too.

It's probably unlikely that a user would do this, but we don't document that this function can panic, so let's make it safer by returning an error.

…L char

Currently it panics in the case that there is a NUL char in the option name, but there's no reason really to treat these bad option names as different from any other. Return an error in this case too.
@lovasoa lovasoa merged commit fd0a184 into rust-or:main May 2, 2026
2 checks passed
@lovasoa

lovasoa commented May 2, 2026

Copy link
Copy Markdown
Contributor

thanks!

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.

2 participants