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

[Fuzzer] Missing Unicode character range at UTF8 validation #4708

Closed
2 tasks done
PedroTadim opened this issue Sep 14, 2022 · 1 comment
Closed
2 tasks done

[Fuzzer] Missing Unicode character range at UTF8 validation #4708

PedroTadim opened this issue Sep 14, 2022 · 1 comment

Comments

@PedroTadim
Copy link
Contributor

What happens?

This morning, the fuzzer triggered another assertion error:

SELECT upper(decode('\xF6\x96\xB0\x85'::BLOB)::VARCHAR);

src/function/scalar/string/caseconvert.cpp:64: duckdb::idx_t duckdb::GetResultLength(const char *, duckdb::idx_t) [IS_UPPER = true]: Assertion `new_sz >= 0' failed.

After some digging, I see Utf8Proc::Analyze is missing validation for Unicode characters not representable by UTF8 as described here: https://en.wikipedia.org/wiki/UTF-8#cite_note-16

This is an issue from my side as well because I shouldn't generate these strings either :) I am going to add the missing validation.

To Reproduce

Run the query above.

OS:

Linux

DuckDB Version:

latest from sources

DuckDB Client:

Shell

Full Name:

Pedro Ferreira

Affiliation:

Huawei

Have you tried this on the latest master branch?

  • I agree

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • I agree
PedroTadim pushed a commit to PedroTadim/duckdb that referenced this issue Sep 14, 2022
Mytherin added a commit that referenced this issue Sep 16, 2022
@Mytherin
Copy link
Collaborator

Fixed by #4711

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

2 participants