Created
February 13, 2017 09:50
-
-
Save srepmub/a065ae74131512a2fe2af6af786667b2 to your computer and use it in GitHub Desktop.
swig_coverity_fixmethods.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Lib/python/pyinit.swg b/Lib/python/pyinit.swg | |
index 2cc582841..fe45ac941 100644 | |
--- a/Lib/python/pyinit.swg | |
+++ b/Lib/python/pyinit.swg | |
@@ -306,9 +306,9 @@ SWIG_Python_FixMethods(PyMethodDef *methods, | |
char *ndoc = (char*)malloc(ldoc + lptr + 10); | |
if (ndoc) { | |
char *buff = ndoc; | |
- strncpy(buff, methods[i].ml_doc, ldoc); | |
+ memcpy(buff, methods[i].ml_doc, ldoc); | |
buff += ldoc; | |
- strncpy(buff, "swig_ptr: ", 10); | |
+ memcpy(buff, "swig_ptr: ", 10); | |
buff += 10; | |
SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); | |
methods[i].ml_doc = ndoc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment