From: Florian Forster Date: Sun, 28 Jun 2015 12:05:05 +0000 (+0200) Subject: src/daemon/common.c: Fix off-by-one error in escape_slashes(). X-Git-Tag: collectd-5.5.1~68^2~17 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=6966c22daad028359bac6747d709416a64779d6a;p=collectd.git src/daemon/common.c: Fix off-by-one error in escape_slashes(). Partial cherry-pick of 0cba91923be9326224f8434e4aae7691f7b6dad1. --- diff --git a/src/common.c b/src/common.c index f41e9506..c2849420 100644 --- a/src/common.c +++ b/src/common.c @@ -445,7 +445,7 @@ int escape_slashes (char *buf, int buf_len) if (buf[0] == '/') memmove (buf, buf + 1, buf_len - 1); - for (i = 0; i < buf_len - 1; i++) + for (i = 0; i < buf_len; i++) { if (buf[i] == '\0') break;