Fix some shadow variables, including one in file_id.cc that causes all files to generate the same hash. Add a test to make sure this doesn't happen again.

Review URL: http://breakpad.appspot.com/316002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@875 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
thestig@chromium.org 2011-10-20 18:23:01 +00:00
parent 70698339f6
commit 11582abc27
6 changed files with 127 additions and 30 deletions

View file

@ -442,7 +442,7 @@ ParseSystemInfo(CrashedProcess* crashinfo, MMappedRange range,
#else
#error "This code has not been ported to your platform yet"
#endif
if (!strstr(full_file.GetString(sysinfo->csd_version_rva).c_str(), "Linux")){
if (!strstr(full_file.GetString(sysinfo->csd_version_rva).c_str(), "Linux")) {
fprintf(stderr, "This minidump was not generated by Linux.\n");
_exit(1);
}
@ -654,9 +654,9 @@ ParseCmdLine(CrashedProcess* crashinfo, MMappedRange range) {
len = range.length() > args_len ? args_len : range.length();
memcpy(crashinfo->prps.pr_psargs, cmdline, len);
for (unsigned i = 0; i < len; ++i) {
if (crashinfo->prps.pr_psargs[i] == 0)
crashinfo->prps.pr_psargs[i] = ' ';
for (unsigned j = 0; j < len; ++j) {
if (crashinfo->prps.pr_psargs[j] == 0)
crashinfo->prps.pr_psargs[j] = ' ';
}
break;
}