aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/strings.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-24 22:29:59 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-24 23:02:51 -0400
commit16b55d2e9d074bb3de7505708c30c05fe02d8f12 (patch)
treeb98175f6003ceaa959be763dcd80c0488cb339be /src/nvim/strings.c
parentbdffa01b528ca6093fc8e0e4f54f810f9bb6d3b7 (diff)
downloadrneovim-16b55d2e9d074bb3de7505708c30c05fe02d8f12.tar.gz
rneovim-16b55d2e9d074bb3de7505708c30c05fe02d8f12.tar.bz2
rneovim-16b55d2e9d074bb3de7505708c30c05fe02d8f12.zip
vim-patch:8.0.1468: illegal memory access in del_bytes()
Problem: Illegal memory access in del_bytes(). Solution: Check for negative byte count. (Christian Brabandt, closes vim/vim#2466) https://github.com/vim/vim/commit/191f18bad0b5c48afa05c3e8a00f3ced993f6a38
Diffstat (limited to 'src/nvim/strings.c')
-rw-r--r--src/nvim/strings.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/strings.c b/src/nvim/strings.c
index f24de72743..17c4a75a64 100644
--- a/src/nvim/strings.c
+++ b/src/nvim/strings.c
@@ -1217,6 +1217,7 @@ int vim_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap,
str_arg_l = 3;
zero_padding = 0;
} else {
+ // Regular float number
format[0] = '%';
size_t l = 1;
if (force_sign) {
@@ -1241,7 +1242,6 @@ int vim_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap,
format[l] = (char)(fmt_spec == 'F' ? 'f' : fmt_spec);
format[l + 1] = NUL;
- // Regular float number
str_arg_l = (size_t)snprintf(tmp, sizeof(tmp), format, f);
assert(str_arg_l < sizeof(tmp));