From owner-svn-src-all@FreeBSD.ORG Sat Oct 17 15:53:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E27D106566C; Sat, 17 Oct 2009 15:53:16 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DA198FC12; Sat, 17 Oct 2009 15:53:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9HFrFml045490; Sat, 17 Oct 2009 15:53:15 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9HFrFCf045488; Sat, 17 Oct 2009 15:53:15 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200910171553.n9HFrFCf045488@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 17 Oct 2009 15:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198189 - head/bin/csh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2009 15:53:16 -0000 Author: ume Date: Sat Oct 17 15:53:15 2009 New Revision: 198189 URL: http://svn.freebsd.org/changeset/base/198189 Log: Check error of dlfunc(3). MFC after: 3 days Modified: head/bin/csh/iconv_stub.c Modified: head/bin/csh/iconv_stub.c ============================================================================== --- head/bin/csh/iconv_stub.c Sat Oct 17 13:42:23 2009 (r198188) +++ head/bin/csh/iconv_stub.c Sat Oct 17 15:53:15 2009 (r198189) @@ -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; }