From: Andy Lester Date: Fri, 6 Mar 2020 04:43:36 +0000 (-0600) Subject: closes bpo-39859: Do not downcast result of hstrerror (GH-18790) X-Git-Tag: v3.9.0a5~168 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e63117a84ef11083be86db7afb2ac2789491ca09;p=thirdparty%2FPython%2Fcpython.git closes bpo-39859: Do not downcast result of hstrerror (GH-18790) set_herror builds a string by calling hstrerror but downcasts its return value to char *. It should be const char *. Automerge-Triggered-By: @benjaminp --- diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 37b312396f94..2818ac7f2057 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -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