From: Timo Kokkonen Date: Tue, 1 Nov 2016 18:56:54 +0000 (+0200) Subject: onewire_parser: Use larger string buffers in make_uncached() X-Git-Url: http://git.itanic.dy.fi/?p=rrdd;a=commitdiff_plain;h=8601dc1c9df7c7fe544cfd8ea6aa83830443d549 onewire_parser: Use larger string buffers in make_uncached() The strings used for temperature sensor paths might be longer than 32 bytes. If that is the case, we might truncate the actual output string, thus making temperature sensors inaccessible in case we might need to read an uncached data from it. This become visible after the glitch detection code started to make frequent re-reads from sensors. Fix it by allocating 1024 bytes for the strings instead of 32 bytes. This should be more than enough. Signed-off-by: Timo Kokkonen --- diff --git a/onewire_parser.c b/onewire_parser.c index fe29aa4..54ba71f 100644 --- a/onewire_parser.c +++ b/onewire_parser.c @@ -112,7 +112,7 @@ static int parse_opts(const char *str, char *ow_path, size_t pathlen, static int make_uncached(char *path, size_t len) { - char p1[32], p2[32], *p = path; + char p1[1024], p2[1024], *p = path; if (strstr(path, "/uncached/")) return 0;