Dean Edmonds - 2007-03-26

Logged In: YES
user_id=336930
Originator: NO

The problem here is that the code assumes that 'unsigned int' is equivalent to 'std::string::size_type', which isn't true on x64. In particular, if std::string::find() returns 'npos' and that is assigned to an 'unsigned int' variable then it will be truncated to a much smaller value. A subsequent attempt to compare that to 'npos' will fail, leading to these crashes.

The fix is to look for every occurrence of 'npos' in the code and change the 'unsigned int' variables in those functions to 'std::string::size_type'.