diff options
author | Keith M Wesolowski <wesolows@foobazco.org> | 2013-08-01 22:41:15 +0000 |
---|---|---|
committer | Robert Mustacchi <rm@joyent.com> | 2013-08-03 08:39:46 -0700 |
commit | 5f7cdf77ce044c1e2ea94040c70f571d331268ec (patch) | |
tree | 2aea1d47873b82aaac0160332a80bcfdb0a35ad1 /usr/src/lib/libc | |
parent | d69cdb36aa7fa9e45aa4508448fc3fa1df12743d (diff) | |
download | illumos-joyent-5f7cdf77ce044c1e2ea94040c70f571d331268ec.tar.gz |
3967 iconv() blows up when passed (iconv_t)-1
Reviewed by: Joshua M. Clulow <josh@sysmgr.org>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src/lib/libc')
-rw-r--r-- | usr/src/lib/libc/port/gen/iconv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr/src/lib/libc/port/gen/iconv.c b/usr/src/lib/libc/port/gen/iconv.c index 6a81557c73..622e26da31 100644 --- a/usr/src/lib/libc/port/gen/iconv.c +++ b/usr/src/lib/libc/port/gen/iconv.c @@ -435,7 +435,7 @@ iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { /* check if cd is valid */ - if (cd == NULL) { + if (cd == NULL || cd == (iconv_t)-1) { errno = EBADF; return ((size_t)-1); } |