From efcd534bd2a1d388f465012f71f710a779bf2b38 Mon Sep 17 00:00:00 2001 From: "kmixter@chromium.org" Date: Wed, 9 Nov 2011 22:39:26 +0000 Subject: 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 --- src/client/linux/handler/exception_handler.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/client/linux/handler') diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc index c2336ccf..7949582f 100644 --- a/src/client/linux/handler/exception_handler.cc +++ b/src/client/linux/handler/exception_handler.cc @@ -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; -- cgit v1.2.1