From 92c4393cdedc12c553363d19658339966fec1a59 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Fri, 14 Dec 2018 17:28:37 +0100 Subject: [PATCH] libcollectdclient: fix minor cosmetic issue String should be NUL-terminated, so compare with the NUL char --- src/libcollectdclient/network_parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcollectdclient/network_parse.c b/src/libcollectdclient/network_parse.c index 14e8be57..4c610bb0 100644 --- a/src/libcollectdclient/network_parse.c +++ b/src/libcollectdclient/network_parse.c @@ -154,7 +154,7 @@ static int parse_string(void *payload, size_t payload_size, char *out, size_t out_size) { char *in = payload; - if ((payload_size < 1) || (in[payload_size - 1] != 0) || + if ((payload_size < 1) || (in[payload_size - 1] != '\0') || (payload_size > out_size)) return EINVAL; -- 2.11.0