Use utf-8 decoding with surrogateescape for invalid utf-8 for env and hdr val
This commit is contained in:
+1
-1
@@ -643,7 +643,7 @@ generic_env_wrapper(SMFICTX *ctx, PyObject*cb, char **argv) {
|
||||
/* There's some error checking performed in do_mkvalue() for a string */
|
||||
/* that's not currently done here - it probably should be */
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
PyObject *o = PyUnicode_FromStringAndSize(argv[i], strlen(argv[i]));
|
||||
PyObject *o = PyBytes_FromStringAndSize(argv[i], strlen(argv[i]));
|
||||
#else
|
||||
PyObject *o = PyString_FromStringAndSize(argv[i], strlen(argv[i]));
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user