summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ScriptInterpreter/Python/PythonReadline.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-12-21 11:33:42 +0100
committerPavel Labath <pavel@labath.sk>2019-12-21 11:35:26 +0100
commit1805d1f87d7835b237f85bfb0595d1f411ebf1bf (patch)
treecb162854137e38ef6655a533c6098943a2c053e0 /lldb/source/Plugins/ScriptInterpreter/Python/PythonReadline.cpp
parent4706a60e8a071f0c6a686c45ed08c7bab0bb8446 (diff)
downloadbcm5719-llvm-1805d1f87d7835b237f85bfb0595d1f411ebf1bf.tar.gz
bcm5719-llvm-1805d1f87d7835b237f85bfb0595d1f411ebf1bf.zip
[lldb] Fix -Wstringop-truncation in PythonReadline.cpp
The size is known and the truncation is deliberate -- use memcpy instead of strncpy.
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonReadline.cpp')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/PythonReadline.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonReadline.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/PythonReadline.cpp
index 674ec9b6140..5f6429f5cd0 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonReadline.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonReadline.cpp
@@ -67,7 +67,7 @@ simple_readline(FILE *stdin, FILE *stdout, char *prompt)
char *ret = (char *)PyMem_Malloc(n + 2);
#endif
if (ret) {
- strncpy(ret, line, n);
+ memcpy(ret, line, n);
free(line);
ret[n] = '\n';
ret[n + 1] = '\0';
OpenPOWER on IntegriCloud