aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/linux/minidump_writer/minidump_writer.cc8
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';
}
}