From: Benjamin Peterson Date: Thu, 21 Aug 2014 02:37:01 +0000 (-0500) Subject: fix error message for invalid curve name X-Git-Tag: v2.7.9rc1~285 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7ed3e29723cad990e41114954692fb50e682ac86;p=thirdparty%2FPython%2Fcpython.git fix error message for invalid curve name --- diff --git a/Modules/_ssl.c b/Modules/_ssl.c index ed4bbfd6d35a..5518032b26ab 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -2855,8 +2855,12 @@ set_ecdh_curve(PySSLContext *self, PyObject *name) } nid = OBJ_sn2nid(name_bytes); if (nid == 0) { + PyObject *r = PyObject_Repr(name); + if (!r) + return NULL; PyErr_Format(PyExc_ValueError, - "unknown elliptic curve name %R", name); + "unknown elliptic curve name %s", PyString_AS_STRING(r)); + Py_DECREF(r); return NULL; } key = EC_KEY_new_by_curve_name(nid);