about summary refs log tree commit diff homepage
path: root/tools
diff options
context:
space:
mode:
authorMartin Nowack <m.nowack@imperial.ac.uk>2023-02-23 22:09:04 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2023-03-17 22:38:16 +0000
commit134571efec28aa754beaba829fe75f666c065845 (patch)
tree63e8f6748da50f3677b79f029870d65b9ef81b27 /tools
parent38b07e7a89f103dc3b690be5382b5a0d9f5aa7fe (diff)
downloadklee-134571efec28aa754beaba829fe75f666c065845.tar.gz
Fix uninitialised memory access while reading last path entry
`>>` can fail and sets internal error information in the istream.
Check the state of istream before pushing the value onto the buffer.
Diffstat (limited to 'tools')
-rw-r--r--tools/klee/main.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
index 59261e49..0b76e904 100644
--- a/tools/klee/main.cpp
+++ b/tools/klee/main.cpp
@@ -617,7 +617,8 @@ void KleeHandler::loadPathFile(std::string name,
   while (f.good()) {
     unsigned value;
     f >> value;
-    buffer.push_back(!!value);
+    if (f.good())
+      buffer.push_back(!!value);
     f.get();
   }
 }