Re: [Passwordsafe-devel] 3.06 Writes Null-terminated Strings, breaks Compatibility
Popular easy-to-use and secure password manager
Brought to you by:
ronys
From: Rony S. <ro...@gm...> - 2007-03-31 12:57:17
|
Hi Frank, Makes sense. I've implemented, tested and committed the change you've suggested - thanks! This could explain a lot of problems people have been reporting with non-English textual data on the Windows version as well. Cheers, Rony -----Original Message----- From: Frank Pilhofer [mailto:fp...@fp...] Sent: Saturday, March 31, 2007 6:22 AM To: Password Safe Development Cc: Rony Shapiro Subject: 3.06 Writes Null-terminated Strings, breaks Compatibility Hi Rony, I've had reports from some users that failed to load Password Safe databases into Password Gorilla, when those databases were generated with Password Safe 3.06 (and, as it turns out, 3.07). Investigation shows that Password Safe 3.06 and later write an additional NUL character at the end of each string. The culprint seems to be a change to PWSfileV3::ToUTF8() in corelib/ PWSfileV3.cpp, near line 797. The m_utf8Len variable ends up including the terminating null character. This length is then passed to WriteCBC(). NUL characters are an artifact of C strings; they are not necessary in other programming languages, and they are not necessary in the file, given each field's explicit length information. And PWSFileV3::FromUTF8() works fine in the absence of a NUL character also. Can you please fix future versions of Password Safe? A "m_utf8Len--;" at the end of ToUTF8(), after the assert statement, should do it. (I haven't tested this; I don't have a VC8 installation at hand.) Frank -- Frank Pilhofer, fp...@fp... |