comparison src/fileio.c @ 6963:4bf9538ff25e v7.4.799

patch 7.4.799 Problem: Accessing memory before an allocated block. Solution: Check for not going before the start of a pattern. (Dominique Pelle)
author Bram Moolenaar <bram@vim.org>
date Tue, 28 Jul 2015 13:33:45 +0200
parents 4db70c94226b
children dc1b678f0e4e
comparison
equal deleted inserted replaced
6962:c622e7e60aa9 6963:4bf9538ff25e
8512 * Find end of the pattern. 8512 * Find end of the pattern.
8513 * Watch out for a comma in braces, like "*.\{obj,o\}". 8513 * Watch out for a comma in braces, like "*.\{obj,o\}".
8514 */ 8514 */
8515 brace_level = 0; 8515 brace_level = 0;
8516 for (endpat = pat; *endpat && (*endpat != ',' || brace_level 8516 for (endpat = pat; *endpat && (*endpat != ',' || brace_level
8517 || endpat[-1] == '\\'); ++endpat) 8517 || (endpat > pat && endpat[-1] == '\\')); ++endpat)
8518 { 8518 {
8519 if (*endpat == '{') 8519 if (*endpat == '{')
8520 brace_level++; 8520 brace_level++;
8521 else if (*endpat == '}') 8521 else if (*endpat == '}')
8522 brace_level--; 8522 brace_level--;