forked from aniani/vim
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)
This commit is contained in:
@@ -4739,7 +4739,7 @@ getargopt(eap)
|
||||
else if (STRNCMP(arg, "bad", 3) == 0)
|
||||
{
|
||||
arg += 3;
|
||||
pp = &eap->bad_char;
|
||||
pp = &eap->bad_char_idx;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -4770,7 +4770,7 @@ getargopt(eap)
|
||||
{
|
||||
/* Check ++bad= argument. Must be a single-byte character, "keep" or
|
||||
* "drop". */
|
||||
p = eap->cmd + eap->bad_char;
|
||||
p = eap->cmd + eap->bad_char_idx;
|
||||
if (STRICMP(p, "keep") == 0)
|
||||
eap->bad_char = BAD_KEEP;
|
||||
else if (STRICMP(p, "drop") == 0)
|
||||
|
Reference in New Issue
Block a user