From cd87d88a930a0b58cfca38678d2e757491c17b26 Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Thu, 7 Mar 2024 21:56:36 +0100 Subject: Fix asan errors It found some really nasty ones :) --- src/main/completion.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/completion.c b/src/main/completion.c index acf7a78..4735c87 100644 --- a/src/main/completion.c +++ b/src/main/completion.c @@ -456,7 +456,7 @@ static uint32_t complete_path(struct completion_context ctx, void *userdata) { // check the input path here since // to_abspath removes trailing slashes - if (path[inlen - 1] != '/') { + if (inlen == 0 || path[inlen - 1] != '/') { dir = dirname(p1); file = basename(p2); } -- cgit v1.2.3