Fix problem with not NULL terminating mapping name.

BUG=453
Review URL: http://breakpad.appspot.com/323001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@881 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
kmixter@chromium.org 2011-11-09 22:39:26 +00:00
parent ec24b1b19e
commit efcd534bd2

View file

@ -503,7 +503,8 @@ void ExceptionHandler::AddMappingInfo(const std::string& name,
info.start_addr = start_address;
info.size = mapping_size;
info.offset = file_offset;
strncpy(info.name, name.c_str(), std::min(name.size(), sizeof(info)));
strncpy(info.name, name.c_str(), sizeof(info.name) - 1);
info.name[sizeof(info.name) - 1] = '\0';
MappingEntry mapping;
mapping.first = info;