Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chatllm: fix undefined behavior in resetContext #2041

Merged
merged 1 commit into from
Mar 6, 2024
Merged

Conversation

cebtenzzre
Copy link
Member

Chat::reset -> ChatLLM::resetContext is called when we change models. This will happen even if no model has been previously loaded.

In that case, m_llModelType is unset (contains a garbage value). regenerateResponse will attempt to read m_llModelType, causing undefined behavior (found by UBSAN) - but it seems like resetResponse was intended here anyway.

Signed-off-by: Jared Van Bortel <jared@nomic.ai>
@manyoso manyoso merged commit 2a91ffd into main Mar 6, 2024
6 of 10 checks passed
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.

None yet

2 participants