From owner-svn-src-stable@FreeBSD.ORG Sun Sep 29 07:42:26 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1C7FE8CE; Sun, 29 Sep 2013 07:42:26 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0A3052A65; Sun, 29 Sep 2013 07:42:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8T7gPer099894; Sun, 29 Sep 2013 07:42:25 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8T7gPJG099893; Sun, 29 Sep 2013 07:42:25 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201309290742.r8T7gPJG099893@svn.freebsd.org> From: Xin LI Date: Sun, 29 Sep 2013 07:42:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r255934 - in stable: 8/lib/libedit 9/lib/libedit X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 07:42:26 -0000 Author: delphij Date: Sun Sep 29 07:42:25 2013 New Revision: 255934 URL: http://svnweb.freebsd.org/changeset/base/255934 Log: MFC r255891: Import NetBSD readline.c,v 1.104: do not crash with add_history(NULL). Modified: stable/8/lib/libedit/readline.c Directory Properties: stable/8/lib/libedit/ (props changed) Changes in other areas also in this revision: Modified: stable/9/lib/libedit/readline.c Directory Properties: stable/9/lib/libedit/ (props changed) Modified: stable/8/lib/libedit/readline.c ============================================================================== --- stable/8/lib/libedit/readline.c Sun Sep 29 01:05:00 2013 (r255933) +++ stable/8/lib/libedit/readline.c Sun Sep 29 07:42:25 2013 (r255934) @@ -1363,6 +1363,9 @@ add_history(const char *line) TYPE(HistEvent) ev; const Char *wline; + if (line == NULL) + return 0; + if (h == NULL || e == NULL) rl_initialize();