From dc6dc7c8f07dad27611721654bc22e9e011f70f1 Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Fri, 3 Nov 2023 00:31:34 +0100 Subject: Safe-guard agains kernel issues --- XUtils.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'XUtils.c') diff --git a/XUtils.c b/XUtils.c index 214b0565..25fc3bd3 100644 --- a/XUtils.c +++ b/XUtils.c @@ -289,6 +289,8 @@ static ssize_t readfd_internal(int fd, void* buffer, size_t count) { } if (res > 0) { + assert(res <= count); + buffer = ((char*)buffer) + res; count -= (size_t)res; alreadyRead += res; -- cgit v1.2.3