Blame SOURCES/openscap-1.3.7-prevent_memory_error-PR_1861.patch

5129c8
From 12f9c02a612bb1687676b74a4739126b1913b1fe Mon Sep 17 00:00:00 2001
5129c8
From: Ajay Nair <ajaynair59@gmail.com>
5129c8
Date: Mon, 9 May 2022 13:31:47 -0400
5129c8
Subject: [PATCH] Reset errno before call to strtoll
5129c8
5129c8
---
5129c8
 src/common/memusage.c | 2 ++
5129c8
 1 file changed, 2 insertions(+)
5129c8
5129c8
diff --git a/src/common/memusage.c b/src/common/memusage.c
5129c8
index c6755f21f1..ffa70b662b 100644
5129c8
--- a/src/common/memusage.c
5129c8
+++ b/src/common/memusage.c
5129c8
@@ -71,6 +71,8 @@ static int read_common_sizet(void *szp, char *strval)
5129c8
 		return (-1);
5129c8
 
5129c8
 	*end = '\0';
5129c8
+
5129c8
+	errno = 0;
5129c8
 	*(size_t *)szp = strtoll(strval, NULL, 10);
5129c8
 
5129c8
 	if (errno == EINVAL ||