Avoid access to freed memory

Access to matches occurs after the buffer the matches point to has
been reassigned.

Fix for bug 585.
This commit is contained in:
Moritz Bunkus 2010-12-22 22:39:43 +01:00
parent a4062a54f5
commit f7facbdf8c

View File

@ -195,10 +195,11 @@ mm_multi_file_io_c::open_multi(const std::string &display_file_name,
return mm_multi_file_io_cptr(new mm_multi_file_io_c(file_names, display_file_name));
}
base_name = downcase(matches[1].str());
int start_number = 1;
parse_int(matches[2].str(), start_number);
base_name = downcase(matches[1].str());
std::vector<path_sorter_t> paths;
paths.push_back(path_sorter_t(first_file_name, start_number));