From a19179dc533ef4d9dac7390578736f5105aee8ef Mon Sep 17 00:00:00 2001 From: Alan Jenkins Date: Tue, 12 Sep 2017 17:11:50 +0100 Subject: [PATCH] src/rrd_daemon.c: never compare uninitialized bytes I don't think this caused the valgrind error in CI either. It looks wrong though. --- src/rrd_daemon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c index 937b86ae..6159ea30 100644 --- a/src/rrd_daemon.c +++ b/src/rrd_daemon.c @@ -2576,7 +2576,8 @@ static int handle_request_list (HANDLER_PROTO) /* {{{ */ } /* Absolute path MUST be starting with base_dir; if not skip the entry. */ - if (memcmp(absolute, base, strlen(base)) != 0) { + if (strlen(absolute) < strlen(base) || + memcmp(absolute, base, strlen(base)) != 0) { goto loop_next; } add_response_info(sock, "%s\n", current); -- 2.47.2