issue 151 - Crash when processing file names less than 4 bytes. r=me

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@196 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
ted.mielczarek 2007-07-05 19:31:59 +00:00
parent 43a81daaba
commit 8408a209cd

View file

@ -110,8 +110,9 @@ SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetSymbolFileAtPath(
// name ends in .pdb, strip the .pdb. Otherwise, add .sym to the non-.pdb
// name.
path.append("/");
string debug_file_extension =
debug_file_name.substr(debug_file_name.size() - 4);
string debug_file_extension;
if (debug_file_name.size() > 4)
debug_file_extension = debug_file_name.substr(debug_file_name.size() - 4);
transform(debug_file_extension.begin(), debug_file_extension.end(),
debug_file_extension.begin(), tolower);
if (debug_file_extension == ".pdb") {