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

Null characters in z3 strings are abstracted to strings incorrectly #6442

Closed
zwimer opened this issue Nov 5, 2022 · 1 comment
Closed

Null characters in z3 strings are abstracted to strings incorrectly #6442

zwimer opened this issue Nov 5, 2022 · 1 comment

Comments

@zwimer
Copy link
Contributor

zwimer commented Nov 5, 2022

For example:

null = z3.StringVal("\0").as_string()
print(len(null), null)

Returns 4 \u{}

This does not happen for other characters, validated via:

import z3
for i in range(255):
    if len(z3.StringVal(chr(i)).as_string()) != 1:
        print(i)

This printed out only 0.

I suspect the issue is that some function returns \u{} instead of \u{0}; thus it is not recognized as a unicode character as \u{1} might be.

@zwimer
Copy link
Contributor Author

zwimer commented Nov 5, 2022

If z3 does not permit null bytes within strings, I think this is still invalid behavior.

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

No branches or pull requests

1 participant