Mercurial > vim
comparison src/eval.c @ 2148:99b225e0dbc1 v7.2.430
updated for version 7.2.430
Problem: The ++bad argument is handled wrong, resulting in an invalid
memory access.
Solution: Use the bad_char field only for the replacement character, add
bad_char_idx to store the position. (Dominique Pelle)
author | Bram Moolenaar <bram@zimbu.org> |
---|---|
date | Fri, 14 May 2010 20:41:05 +0200 |
parents | e10d3c073449 |
children | 99b00399c7b4 |
comparison
equal
deleted
inserted
replaced
2147:2bd29808d1f6 | 2148:99b225e0dbc1 |
---|---|
18307 if (eap->force_ff != 0) | 18307 if (eap->force_ff != 0) |
18308 len += (unsigned)STRLEN(eap->cmd + eap->force_ff) + 6; | 18308 len += (unsigned)STRLEN(eap->cmd + eap->force_ff) + 6; |
18309 # ifdef FEAT_MBYTE | 18309 # ifdef FEAT_MBYTE |
18310 if (eap->force_enc != 0) | 18310 if (eap->force_enc != 0) |
18311 len += (unsigned)STRLEN(eap->cmd + eap->force_enc) + 7; | 18311 len += (unsigned)STRLEN(eap->cmd + eap->force_enc) + 7; |
18312 if (eap->bad_char != 0) | 18312 if (eap->bad_char_idx != 0) |
18313 len += (unsigned)STRLEN(eap->cmd + eap->bad_char) + 7; | 18313 len += (unsigned)STRLEN(eap->cmd + eap->bad_char_idx) + 7; |
18314 # endif | 18314 # endif |
18315 | 18315 |
18316 newval = alloc(len + 1); | 18316 newval = alloc(len + 1); |
18317 if (newval == NULL) | 18317 if (newval == NULL) |
18318 return NULL; | 18318 return NULL; |
18332 eap->cmd + eap->force_ff); | 18332 eap->cmd + eap->force_ff); |
18333 # ifdef FEAT_MBYTE | 18333 # ifdef FEAT_MBYTE |
18334 if (eap->force_enc != 0) | 18334 if (eap->force_enc != 0) |
18335 sprintf((char *)newval + STRLEN(newval), " ++enc=%s", | 18335 sprintf((char *)newval + STRLEN(newval), " ++enc=%s", |
18336 eap->cmd + eap->force_enc); | 18336 eap->cmd + eap->force_enc); |
18337 if (eap->bad_char != 0) | 18337 if (eap->bad_char_idx != 0) |
18338 sprintf((char *)newval + STRLEN(newval), " ++bad=%s", | 18338 sprintf((char *)newval + STRLEN(newval), " ++bad=%s", |
18339 eap->cmd + eap->bad_char); | 18339 eap->cmd + eap->bad_char_idx); |
18340 # endif | 18340 # endif |
18341 vimvars[VV_CMDARG].vv_str = newval; | 18341 vimvars[VV_CMDARG].vv_str = newval; |
18342 return oldval; | 18342 return oldval; |
18343 } | 18343 } |
18344 #endif | 18344 #endif |