From b33e375b2b4e6c9232cdbfd5d6b7cb1b15e0f525 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Tue, 25 Aug 2020 12:40:50 +0200 Subject: robustness: avoid adding offset to NULL pointer UBSAN with clang 10.0 is checking for adding offsets to a `NULL` pointer which is not allowed. This is not yet checked in the version of clang used in CI (7.0.0). I will work on cases of this so that tests passes locally for me. This could be tested in CI by either upgrading the clang of the ASAN/UBSAN to 10.0, or add yet another CI target which builds with clang 10.0. --- src/nvim/eval/decode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/eval/decode.c') diff --git a/src/nvim/eval/decode.c b/src/nvim/eval/decode.c index daba304f00..638fef331a 100644 --- a/src/nvim/eval/decode.c +++ b/src/nvim/eval/decode.c @@ -586,7 +586,7 @@ parse_json_number_check: if (p == ints) { emsgf(_("E474: Missing number after minus sign: %.*s"), LENP(s, e)); goto parse_json_number_fail; - } else if (p == fracs || exps_s == fracs + 1) { + } else if (p == fracs || (fracs != NULL && exps_s == fracs + 1)) { emsgf(_("E474: Missing number after decimal dot: %.*s"), LENP(s, e)); goto parse_json_number_fail; } else if (p == exps) { -- cgit