From owner-svn-src-all@FreeBSD.ORG Tue Oct 20 13:47:05 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 DD101106566C; Tue, 20 Oct 2009 13:47:05 +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 CBA838FC24; Tue, 20 Oct 2009 13:47:05 +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 n9KDl53J068656; Tue, 20 Oct 2009 13:47:05 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KDl5eN068654; Tue, 20 Oct 2009 13:47:05 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200910201347.n9KDl5eN068654@svn.freebsd.org> From: Hajimu UMEMOTO Date: Tue, 20 Oct 2009 13:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198285 - stable/7/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 13:47:06 -0000 Author: ume Date: Tue Oct 20 13:47:05 2009 New Revision: 198285 URL: http://svn.freebsd.org/changeset/base/198285 Log: MFC r198189: Check error of dlfunc(3). Modified: stable/7/bin/csh/ (props changed) stable/7/bin/csh/iconv_stub.c Modified: stable/7/bin/csh/iconv_stub.c ============================================================================== --- stable/7/bin/csh/iconv_stub.c Tue Oct 20 13:34:41 2009 (r198284) +++ stable/7/bin/csh/iconv_stub.c Tue Oct 20 13:47:05 2009 (r198285) @@ -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; }