Linux: Avoid truncating the vendor id.
Review URL: https://breakpad.appspot.com/495002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1079 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
d45abdd839
commit
81885eea47
1 changed files with 3 additions and 5 deletions
|
@ -1250,12 +1250,10 @@ class MinidumpWriter {
|
|||
size_t length = my_strlen(value);
|
||||
if (length == 0)
|
||||
goto popline;
|
||||
my_strlcpy(vendor_id, value, sizeof(vendor_id));
|
||||
// we don't want the trailing newline
|
||||
if (value[length - 1] == '\n')
|
||||
length--;
|
||||
// ensure we have space for the value
|
||||
if (length < sizeof(vendor_id))
|
||||
my_strlcpy(vendor_id, value, length);
|
||||
if (length < sizeof(vendor_id) && vendor_id[length - 1] == '\n')
|
||||
vendor_id[length - 1] == '\0';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue