From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5159 invoked by alias); 13 Mar 2014 13:44:12 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32480 Received: (qmail 3818 invoked from network); 13 Mar 2014 13:44:06 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-Biglobe-Sender: From: "Jun T." Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: core dump in vichange() Message-Id: <83FCB166-FC90-4A7A-80A2-6A0420FFA87A@kba.biglobe.ne.jp> Date: Thu, 13 Mar 2014 21:31:59 +0900 To: zsh-workers@zsh.org Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) X-Mailer: Apple Mail (2.1874) The following causes a core dump in function vichange(): $ zsh -f $ bindkey -v $ echo foo $ kcw k=3Dup-line-or-history, c=3Dvi-change, w=3Dvi-forward-word (or 'kc' followed by any motion command) The core dump is at line 404 of zle_vi.c: vistartchange =3D curchange->prev->changeno; with curchange->prev =3D=3D NULL. diff --git a/Src/Zle/zle_vi.c b/Src/Zle/zle_vi.c index 994b44f..9e39143 100644 --- a/Src/Zle/zle_vi.c +++ b/Src/Zle/zle_vi.c @@ -401,7 +401,7 @@ vichange(UNUSED(char **args)) forekill(c2 - zlecs, CUT_RAW); selectkeymap("main", 1); viinsbegin =3D zlecs; - vistartchange =3D curchange->prev->changeno; + vistartchange =3D (curchange && curchange->prev) ? = curchange->prev->changeno : 0; } return ret; }