3.06 Writes Null-terminated Strings, breaks Compatibility
"Frank Pilhofer" <[email protected]> Fri, 30 Mar 2007 23:22:13 -0400
| Newsgroups | gmane.comp.security.passwordsafe.devel |
|---|---|
| Message-ID | <[email protected]> |
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, [email protected] ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV