mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-31 06:50:06 +03:00
encoding: Handle iconv() returning EOPNOTSUPP on Apple
iconv() really shouldn't return undocumented error codes.
This commit is contained in:
parent
8d7e38d536
commit
c4f760be8a
@ -1117,6 +1117,14 @@ xmlIconvConvert(unsigned char *out, int *outlen,
|
||||
*/
|
||||
if (errno == EINVAL)
|
||||
return(XML_ENC_ERR_SUCCESS);
|
||||
#ifdef __APPLE__
|
||||
/*
|
||||
* Apple's new libiconv can return EOPNOTSUPP under
|
||||
* unknown circumstances (detected when fuzzing).
|
||||
*/
|
||||
if (errno == EOPNOTSUPP)
|
||||
return(XML_ENC_ERR_INPUT);
|
||||
#endif
|
||||
return(XML_ENC_ERR_INTERNAL);
|
||||
}
|
||||
return(XML_ENC_ERR_SUCCESS);
|
||||
|
Loading…
x
Reference in New Issue
Block a user