Created
February 13, 2017 09:50
-
-
Save srepmub/003ad31170991ff69be0cc5a3bd51ab5 to your computer and use it in GitHub Desktop.
swig_coverity_pytuple_check.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/Source/Modules/python.cxx b/Source/Modules/python.cxx | |
index a6801fc4e..ae87c606e 100644 | |
--- a/Source/Modules/python.cxx | |
+++ b/Source/Modules/python.cxx | |
@@ -2542,7 +2542,7 @@ public: | |
if (!fastunpack) { | |
Wrapper_add_local(f, "ii", "Py_ssize_t ii"); | |
if (maxargs - (add_self ? 1 : 0) > 0) | |
- Append(f->code, "if (!PyTuple_Check(args)) SWIG_fail;\n"); | |
+ Append(f->code, "if (args && !PyTuple_Check(args)) SWIG_fail;\n"); | |
Append(f->code, "argc = args ? PyObject_Length(args) : 0;\n"); | |
if (add_self) | |
Append(f->code, "argv[0] = self;\n"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment