On Fri, Jul 9, 2010 at 10:48 AM, Eric Smith <eas....@gmail.com> wrote:
> Will sqlite3_bind_text work properly if the string contains (internal)
> nulls?  What if I did something like:
> char zText[100];
> memset(zText, 0, sizeof(zText));
> sqlite3_bind_text(stmt, idx, zText, sizeof(zText), SQLITE_TRANSIENT);

If you *really* want to work with your password information as a
string / using string functions, convert / encode it to regular text
first.  The trivial case would encode to hex characters, changing your
null characters to '00', which any of the string functions would
happily handle.  That encoding would double the storage space needed
for the password, but string handling would be *safe*.  Other
encodings [that produce standard text characters] would also work.
These would still require more storage than the raw 'binary' data you
have, but most would be less than the double storage needed by the hex
sqlite-users mailing list

Reply via email to