diff options
author | Kyle Evans <kevans@FreeBSD.org> | 2023-05-28 17:52:51 +0000 |
---|---|---|
committer | Kyle Evans <kevans@FreeBSD.org> | 2023-06-20 20:11:48 +0000 |
commit | a977fb7c841a4e4b87ab8c94d48d0e342aa47014 (patch) | |
tree | 5d2e34eb4601f6df03db56e8e92c05fa72dddfcf /lib/libc/locale | |
parent | 72cf63a259b5038560bd039b9ec3bcb11e0b3d5d (diff) |
libc: locale: fix collation file size validation
At a minimum, we need enough for the colllation format version string +
locale definition version string and a full collate_info definition,
rather than just the first two and a pointer.
Sponsored by: Klara, Inc.
(cherry picked from commit e15da6b10a4971f43aa604fca3ea43effa096f4c)
Diffstat (limited to 'lib/libc/locale')
-rw-r--r-- | lib/libc/locale/collate.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/locale/collate.c b/lib/libc/locale/collate.c index 2f0e2003aa45..c3b66e1f0534 100644 --- a/lib/libc/locale/collate.c +++ b/lib/libc/locale/collate.c @@ -148,7 +148,7 @@ __collate_load_tables_l(const char *encoding, struct xlocale_collate *table) } if (sbuf.st_size < (COLLATE_FMT_VERSION_LEN + XLOCALE_DEF_VERSION_LEN + - sizeof (info))) { + sizeof (*info))) { (void) _close(fd); errno = EINVAL; return (_LDP_ERROR); |