To: vim-dev@vim.org Subject: Patch 6.0.178 Fcc: outbox From: Bram Moolenaar MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.0.178 Problem: Uninitialized memory read from xp_backslash field. Solution: Initialize xp_backslash field properly. Files: src/eval.c, src/ex_docmd.c, src/ex_getln.c, src/misc1.c, src/tag.c *** ../vim60.177/src/eval.c Mon Feb 4 17:08:29 2002 --- src/eval.c Mon Feb 4 22:02:26 2002 *************** *** 3369,3374 **** --- 3369,3375 ---- if (argvars[1].var_type != VAR_UNKNOWN && get_var_number(&argvars[1])) flags |= WILD_KEEP_ALL; xpc.xp_context = EXPAND_FILES; + xpc.xp_backslash = XP_BS_NONE; retvar->var_val.var_string = ExpandOne(&xpc, s, NULL, flags, WILD_ALL); } } *************** *** 3907,3912 **** --- 3908,3914 ---- expand_T xpc; xpc.xp_context = EXPAND_FILES; + xpc.xp_backslash = XP_BS_NONE; retvar->var_type = VAR_STRING; retvar->var_val.var_string = ExpandOne(&xpc, get_var_string(&argvars[0]), NULL, WILD_USE_NL|WILD_SILENT, WILD_ALL); *** ../vim60.177/src/ex_docmd.c Sun Feb 3 15:27:26 2002 --- src/ex_docmd.c Mon Feb 4 20:30:16 2002 *************** *** 3315,3320 **** --- 3315,3321 ---- expand_T xpc; xpc.xp_context = EXPAND_FILES; + xpc.xp_backslash = XP_BS_NONE; if ((p = ExpandOne(&xpc, eap->arg, NULL, WILD_LIST_NOTFOUND|WILD_ADD_SLASH, WILD_EXPAND_FREE)) == NULL) *** ../vim60.177/src/ex_getln.c Wed Jan 16 12:28:44 2002 --- src/ex_getln.c Mon Feb 4 20:34:30 2002 *************** *** 207,212 **** --- 207,213 ---- set_cmdspos(); } xpc.xp_context = EXPAND_NOTHING; + xpc.xp_backslash = XP_BS_NONE; /* * Avoid scrolling when called by a recursive do_cmdline(), e.g. when *************** *** 2370,2376 **** * options = WILD_SILENT: don't print warning messages * options = WILD_ESCAPE: put backslash before special chars * ! * The variable xp->xp_context must have been set! */ char_u * ExpandOne(xp, str, orig, options, mode) --- 2371,2377 ---- * options = WILD_SILENT: don't print warning messages * options = WILD_ESCAPE: put backslash before special chars * ! * The variables xp->xp_context and xp->xp_backslash must have been set! */ char_u * ExpandOne(xp, str, orig, options, mode) *************** *** 3403,3408 **** --- 3404,3410 ---- cmd_numfiles = -1; xpc.xp_context = EXPAND_FILES; + xpc.xp_backslash = XP_BS_NONE; ga_init2(&ga, 1, 100); /* Loop over all entries in {path}. */ *** ../vim60.177/src/misc1.c Mon Dec 31 17:47:49 2001 --- src/misc1.c Mon Feb 4 21:31:34 2002 *************** *** 2968,2973 **** --- 2968,2974 ---- expand_T xpc; xpc.xp_context = EXPAND_FILES; + xpc.xp_backslash = XP_BS_NONE; var = ExpandOne(&xpc, dst, NULL, WILD_ADD_SLASH|WILD_SILENT, WILD_EXPAND_FREE); mustfree = TRUE; *** ../vim60.177/src/tag.c Fri Sep 14 21:46:03 2001 --- src/tag.c Mon Feb 4 20:34:11 2002 *************** *** 2711,2716 **** --- 2711,2717 ---- if (expand && mch_has_wildcard(fname)) { xpc.xp_context = EXPAND_FILES; + xpc.xp_backslash = XP_BS_NONE; expanded_fname = ExpandOne(&xpc, (char_u *)fname, NULL, WILD_LIST_NOTFOUND|WILD_SILENT, WILD_EXPAND_FREE); if (expanded_fname != NULL) *** ../vim60.177/src/version.c Mon Feb 4 17:29:45 2002 --- src/version.c Mon Feb 4 22:27:51 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 178, /**/ -- hundred-and-one symptoms of being an internet addict: 206. You religiously respond immediately to e-mail, while ignoring your growing pile of snail mail. /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim ))) \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///