From 8e20b77bd1604062f0cf7182a2e3a6ae8c9fc6d3 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 20 May 2018 08:36:40 +0200 Subject: strings.c: Fix PVS/V781: value of 'l + 1' is checked after it was used --- src/nvim/strings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/strings.c b/src/nvim/strings.c index b3a0e4816b..52677738e8 100644 --- a/src/nvim/strings.c +++ b/src/nvim/strings.c @@ -1253,11 +1253,11 @@ int vim_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap, } // Cast to char to avoid a conversion warning on Ubuntu 12.04. + assert(l + 1 < sizeof(format)); format[l] = (char)(fmt_spec == 'F' ? 'f' : fmt_spec); format[l + 1] = NUL; // Regular float number - assert(l + 1 < sizeof(format)); str_arg_l = (size_t)snprintf(tmp, sizeof(tmp), format, f); assert(str_arg_l < sizeof(tmp)); -- cgit From e24d338194a5720dbc2268f659897eb9cffd34cc Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 20 May 2018 08:41:20 +0200 Subject: getchar.c: Fix PVS/V522: Dereference of null pointer mp_match --- src/nvim/getchar.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 07a65c2611..9a2ecbfbd8 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -1854,6 +1854,7 @@ static int vgetorpeek(int advance) } } else if (keylen > mp_match_len || (keylen == mp_match_len + && mp_match != NULL && (mp_match->m_mode & LANGMAP) == 0 && (mp->m_mode & LANGMAP) != 0)) { // found a longer match -- cgit From 5284b85d07a75d043bdf85bd3f63a0703675028a Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 20 May 2018 08:46:06 +0200 Subject: socket.c: Ignore PVS/V547: False positive https://github.com/neovim/neovim/pull/8218#issuecomment-383412049 --- src/nvim/event/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/event/socket.c b/src/nvim/event/socket.c index 6f45b09fce..6fcb9f7e7a 100644 --- a/src/nvim/event/socket.c +++ b/src/nvim/event/socket.c @@ -252,7 +252,7 @@ tcp_retry: } status = 1; LOOP_PROCESS_EVENTS_UNTIL(&main_loop, NULL, timeout, status != 1); - if (status == 0) { + if (status == 0) { // -V547 stream_init(NULL, stream, -1, uv_stream); success = true; } else if (is_tcp && addrinfo->ai_next) { -- cgit