vlcn-io / cr-sqlite

Convergent, Replicated SQLite. Multi-writer and CRDT support for SQLite
https://vlcn.io
MIT License
2.61k stars 69 forks source link

Fix missing null terminator in schema name #430

Closed guusw closed 4 weeks ago

guusw commented 2 months ago

So we were having some issues in release builds, apparently there is an undefined behavior conversion from "main" (rust string, NOT NULL TERMINATED) to &str using CStr::from_ptr (which expects a null terminated string)

This seems to be a decent fix, although you might want to go over similar code, there might be cases I missed. Also the error codes are slightly vague, since all these conversions just return "out of memory" even though it's not what's going on. Thanks.