]> git.itanic.dy.fi Git - rrdd/commitdiff
onewire_parser: Use larger string buffers in make_uncached()
authorTimo Kokkonen <timo.t.kokkonen@iki.fi>
Tue, 1 Nov 2016 18:56:54 +0000 (20:56 +0200)
committerTimo Kokkonen <timo.t.kokkonen@iki.fi>
Tue, 1 Nov 2016 18:56:54 +0000 (20:56 +0200)
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 <timo.t.kokkonen@iki.fi>
onewire_parser.c

index fe29aa483c2f01749c029d0f7e74908ba3dbaa8e..54ba71fbf6f7d13d0294499ed13b466dd6d129b2 100644 (file)
@@ -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;