From owner-svn-src-all@FreeBSD.ORG Tue Oct 20 11:52:39 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 B985D1065696; Tue, 20 Oct 2009 11:52:39 +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 A82958FC1D; Tue, 20 Oct 2009 11:52:39 +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 n9KBqdXZ066115; Tue, 20 Oct 2009 11:52:39 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KBqd7T066113; Tue, 20 Oct 2009 11:52:39 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200910201152.n9KBqd7T066113@svn.freebsd.org> From: Hajimu UMEMOTO Date: Tue, 20 Oct 2009 11:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198276 - stable/8/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: Tue, 20 Oct 2009 11:52:39 -0000 Author: ume Date: Tue Oct 20 11:52:39 2009 New Revision: 198276 URL: http://svn.freebsd.org/changeset/base/198276 Log: MFC r198189: Check error of dlfunc(3). Approved by: re (kib) Modified: stable/8/bin/csh/ (props changed) stable/8/bin/csh/iconv_stub.c Modified: stable/8/bin/csh/iconv_stub.c ============================================================================== --- stable/8/bin/csh/iconv_stub.c Tue Oct 20 10:40:01 2009 (r198275) +++ stable/8/bin/csh/iconv_stub.c Tue Oct 20 11:52:39 2009 (r198276) @@ -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; }