From: Alan Jenkins Date: Tue, 12 Sep 2017 16:11:50 +0000 (+0100) Subject: src/rrd_daemon.c: never compare uninitialized bytes X-Git-Tag: v1.7.1~110^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F819%2Fhead;p=thirdparty%2Frrdtool-1.x.git src/rrd_daemon.c: never compare uninitialized bytes I don't think this caused the valgrind error in CI either. It looks wrong though. --- 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);