From 8601dc1c9df7c7fe544cfd8ea6aa83830443d549 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Tue, 1 Nov 2016 20:56:54 +0200 Subject: [PATCH] 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 --- onewire_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.44.0