git: e15da6b10a49 - main - libc: locale: fix collation file size validation
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 28 May 2023 18:01:11 UTC
The branch main has been updated by kevans:
URL: https://cgit.FreeBSD.org/src/commit/?id=e15da6b10a4971f43aa604fca3ea43effa096f4c
commit e15da6b10a4971f43aa604fca3ea43effa096f4c
Author: Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2023-05-28 17:52:51 +0000
Commit: Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2023-05-28 17:54:24 +0000
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.
---
lib/libc/locale/collate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/libc/locale/collate.c b/lib/libc/locale/collate.c
index 8360c62badd4..c4e7d1cddba1 100644
--- a/lib/libc/locale/collate.c
+++ b/lib/libc/locale/collate.c
@@ -159,7 +159,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);