diff options
author | thestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2012-11-09 19:15:06 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2012-11-09 19:15:06 +0000 |
commit | 81885eea475c4842a57f090eb5029ac6d3683916 (patch) | |
tree | abf349aab09f1d9a199bf4656a63eb7b9f11f127 /src/client/linux/minidump_writer | |
parent | Minor cleanup in src/client/linux/minidump_writer/minidump_writer_unittest.cc. (diff) | |
download | breakpad-81885eea475c4842a57f090eb5029ac6d3683916.tar.xz |
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
Diffstat (limited to 'src/client/linux/minidump_writer')
-rw-r--r-- | src/client/linux/minidump_writer/minidump_writer.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/client/linux/minidump_writer/minidump_writer.cc b/src/client/linux/minidump_writer/minidump_writer.cc index 5a0f8c14..4167b1bc 100644 --- a/src/client/linux/minidump_writer/minidump_writer.cc +++ b/src/client/linux/minidump_writer/minidump_writer.cc @@ -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'; } } |