aboutsummaryrefslogtreecommitdiffstats
path: root/lib/env.c
diff options
context:
space:
mode:
authorThomas Weißschuh <thomas@t-8ch.de>2023-09-22 11:19:37 +0200
committerThomas Weißschuh <thomas@t-8ch.de>2023-09-22 20:22:21 +0200
commit07ef43df33d4b768bc93e0961b905c459d3ece6d (patch)
treef18e6042cde5804d3b0bfb7dfd4ecdaa8e289ba3 /lib/env.c
parent1e0ad14b3ac08d855cda6de346a65f9b834e00db (diff)
downloadutil-linux-07ef43df33d4b768bc93e0961b905c459d3ece6d.tar.gz
lib/env: avoid underflow of read_all_alloc() return value
read_all_alloc() returns a negative error on failure. When casting this to an unsigned type the failure check "< 1" will not work. Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
Diffstat (limited to 'lib/env.c')
-rw-r--r--lib/env.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/env.c b/lib/env.c
index 2ccabff6fc..2b3395c53b 100644
--- a/lib/env.c
+++ b/lib/env.c
@@ -90,7 +90,7 @@ static struct ul_env_list *env_list_add(struct ul_env_list *ls0, const char *str
struct ul_env_list *env_from_fd(int fd)
{
char *buf = NULL, *p;
- size_t rc = 0;
+ ssize_t rc = 0;
struct ul_env_list *ls = NULL;
if ((rc = read_all_alloc(fd, &buf)) < 1)