Fix coverity issue - ensure that the buffer is null terminated 86/215486/2
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>
Wed, 9 Oct 2019 08:26:06 +0000 (10:26 +0200)
committerMateusz Moscicki <m.moscicki2@partner.samsung.com>
Wed, 9 Oct 2019 09:23:42 +0000 (11:23 +0200)
Change-Id: Ia5eb44790320f48f6751aa247d1d600cb01a9f10

src/livedumper/core.hpp

index bd1737c..54bcf9b 100644 (file)
@@ -462,6 +462,7 @@ class Core {
 
                        char buff[PAGESIZE];
                        ReadFromFile(mem_fd, addr, buff, sizeof(buff));
+                       buff[sizeof(buff)-1] = 0;
 
                        if (buff[0] != 0) {
                                DumpData(mem_fd, core_file, addr, strnlen(buff, sizeof(buff)) + 1, "l_name");