From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21586 invoked by alias); 20 Dec 2011 16:38:33 -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: 30033 Received: (qmail 25305 invoked from network); 20 Dec 2011 16:38:32 -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 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <111220083828.ZM11120@torch.brasslantern.com> Date: Tue, 20 Dec 2011 08:38:28 -0800 X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: PATCH: valgrind complains about init_keymaps MIME-version: 1.0 Content-type: text/plain; charset=us-ascii While testing something else I accidentally executed a command out of my history that started up my latest zsh build under valgrind. Got a bunch of these: ==10918== Conditional jump or move depends on uninitialised value(s) ==10918== at 0x80C5593: metafy (utils.c:3962) ==10918== by 0x810F9F2: bindkey (zle_keymap.c:547) ==10918== by 0x811123C: add_cursor_key (zle_keymap.c:1253) ==10918== by 0x8111540: default_bindings (zle_keymap.c:1329) ==10918== by 0x81110E4: init_keymaps (zle_keymap.c:1192) ==10918== Conditional jump or move depends on uninitialised value(s) ==10918== at 0x4005E89: strlen (mac_replace_strmem.c:243) ==10918== by 0x80B3EFF: ztrdup (string.c:52) ==10918== by 0x810FA24: bindkey (zle_keymap.c:548) ==10918== by 0x811123C: add_cursor_key (zle_keymap.c:1253) ==10918== by 0x8111540: default_bindings (zle_keymap.c:1329) ==10918== by 0x81110E4: init_keymaps (zle_keymap.c:1192) There are several more all of which have in common zle_keymap.c:548 or zle_keymap.c:547 542 if(!bind || ztrlen(seq) > 1) { 543 /* key needs to become a prefix if isn't one already */ 544 if(km->first[f]) { 545 char fs[3]; 546 fs[0] = f; 547 metafy(fs, 1, META_NOALLOC); 548 km->multi->addnode(km->multi, ztrdup(fs), 549 makekeynode(km->first[f], NULL)); 550 km->first[f] = NULL; 551 } Index: Src/Zle/zle_keymap.c =================================================================== diff -u -r1.19 zle_keymap.c --- Src/Zle/zle_keymap.c 21 Dec 2010 16:41:16 -0000 1.19 +++ Src/Zle/zle_keymap.c 20 Dec 2011 16:34:32 -0000 @@ -544,6 +544,7 @@ if(km->first[f]) { char fs[3]; fs[0] = f; + fs[1] = 0; metafy(fs, 1, META_NOALLOC); km->multi->addnode(km->multi, ztrdup(fs), makekeynode(km->first[f], NULL)); -- Barton E. Schaefer