From 134571efec28aa754beaba829fe75f666c065845 Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Thu, 23 Feb 2023 22:09:04 +0000 Subject: 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. --- tools/klee/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tools') 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(); } } -- cgit 1.4.1