]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
closes bpo-39859: Do not downcast result of hstrerror (GH-18790)
authorAndy Lester <andy@petdance.com>
Fri, 6 Mar 2020 04:43:36 +0000 (22:43 -0600)
committerGitHub <noreply@github.com>
Fri, 6 Mar 2020 04:43:36 +0000 (20:43 -0800)
set_herror builds a string by calling hstrerror but downcasts its return value to char *.  It should be const char *.

Automerge-Triggered-By: @benjaminp
Modules/socketmodule.c

index 37b312396f9440bc2af4bb3cc9408a8b271989aa..2818ac7f2057068290161356e14bfb3125b05ff5 100644 (file)
@@ -658,7 +658,7 @@ set_herror(int h_error)
     PyObject *v;
 
 #ifdef HAVE_HSTRERROR
-    v = Py_BuildValue("(is)", h_error, (char *)hstrerror(h_error));
+    v = Py_BuildValue("(is)", h_error, hstrerror(h_error));
 #else
     v = Py_BuildValue("(is)", h_error, "host not found");
 #endif