aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-05-28 12:57:21 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-05-28 12:57:28 +0200
commitf1bf2fb68416b9da50eedd1e6fe97627c21f704f (patch)
tree67e306598aa2e8434a41691c44561500836e6cb1
parent95a0adfe7804e774b9e60bc528e32ff002127cb9 (diff)
downloadslcl-f1bf2fb68416b9da50eedd1e6fe97627c21f704f.tar.gz
auth.c: Fix wrong size check
Otherwise, sb.st_size + 1 would exceed SIZE_MAX.
-rw-r--r--auth.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/auth.c b/auth.c
index e6f86fe..09a5faa 100644
--- a/auth.c
+++ b/auth.c
@@ -34,7 +34,7 @@ static char *dump_db(const char *const path)
fprintf(stderr, "%s: stat(2): %s\n", __func__, strerror(errno));
goto end;
}
- else if (sb.st_size > SIZE_MAX)
+ else if (sb.st_size > SIZE_MAX - 1)
{
fprintf(stderr, "%s: %s too big (%llu bytes, %zu max)\n",
__func__, path, (unsigned long long)sb.st_size, (size_t)SIZE_MAX);