summaryrefslogtreecommitdiffstats
path: root/lldb/test
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test')
-rw-r--r--lldb/test/crashinfo.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lldb/test/crashinfo.c b/lldb/test/crashinfo.c
index 8398d14d035..718cb006e92 100644
--- a/lldb/test/crashinfo.c
+++ b/lldb/test/crashinfo.c
@@ -33,10 +33,11 @@ static PyObject* setCrashReporterDescription(PyObject* self, PyObject* string)
{
Py_ssize_t size = PyString_Size(string);
char* data = PyString_AsString(string);
- if (size && data)
+ if (size > 0 && data)
{
+ ++size; // Include the NULL terminateor in allocation and memcpy()
__crashreporter_info__ = malloc(size);
- memcpy(__crashreporter_info__,data,size+1);
+ memcpy(__crashreporter_info__, data, size);
return Py_True;
}
}
OpenPOWER on IntegriCloud