From 3611f1dd894f68cd21dfd1a9d62a3e3bcc0a778c Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 8 Aug 2021 11:47:03 -0500 Subject: [PATCH] Fix null termination issue if /proc/cpuinfo was over 4KB --- src/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.c b/src/config.c index 328cd57..30f4a64 100644 --- a/src/config.c +++ b/src/config.c @@ -333,7 +333,7 @@ void config_parse(int argc, char* argv[], PCONFIGURATION config) { #ifdef __arm__ char cpuinfo[4096] = {}; - if (read_file("/proc/cpuinfo", cpuinfo, sizeof(cpuinfo)) > 0) { + if (read_file("/proc/cpuinfo", cpuinfo, sizeof(cpuinfo) - 1) > 0) { // If this is a ARMv6 CPU (like the Pi 1), we'll assume it's not // powerful enough to handle audio encryption. The Pi 1 could // barely handle Opus decoding alone.