svn commit: r198286 - stable/6/bin/csh
Hajimu UMEMOTO
ume at FreeBSD.org
Tue Oct 20 13:49:34 UTC 2009
Author: ume
Date: Tue Oct 20 13:49:34 2009
New Revision: 198286
URL: http://svn.freebsd.org/changeset/base/198286
Log:
MFC r198189: Check error of dlfunc(3).
Modified:
stable/6/bin/csh/ (props changed)
stable/6/bin/csh/iconv_stub.c
Modified: stable/6/bin/csh/iconv_stub.c
==============================================================================
--- stable/6/bin/csh/iconv_stub.c Tue Oct 20 13:47:05 2009 (r198285)
+++ stable/6/bin/csh/iconv_stub.c Tue Oct 20 13:49:34 2009 (r198286)
@@ -61,9 +61,20 @@ dl_iconv_open(const char *tocode, const
if (iconvlib == NULL)
return (iconv_t)-1;
iconv_open = (iconv_open_t *)dlfunc(iconvlib, ICONV_OPEN);
+ if (iconv_open == NULL)
+ goto dlfunc_err;
dl_iconv = (dl_iconv_t *)dlfunc(iconvlib, ICONV_ENGINE);
+ if (dl_iconv == NULL)
+ goto dlfunc_err;
dl_iconv_close = (dl_iconv_close_t *)dlfunc(iconvlib,
ICONV_CLOSE);
+ if (dl_iconv_close == NULL)
+ goto dlfunc_err;
}
return iconv_open(tocode, fromcode);
+
+dlfunc_err:
+ dlclose(iconvlib);
+ iconvlib = NULL;
+ return (iconv_t)-1;
}
More information about the svn-src-all
mailing list