LibC: Use a sensible MB_CUR_MAX
value
We always use UTF-8, meaning that a single `wchar_t` might be converted into up to 4 `char`s. This would cause a buffer overflow if something actually relied on this being the right value.
This commit is contained in:
parent
ba975f4ba4
commit
b3ac24a939
Notes:
sideshowbarker
2024-07-18 01:57:15 +09:00
Author: https://github.com/BertalanD Commit: https://github.com/SerenityOS/serenity/commit/b3ac24a9393 Pull-request: https://github.com/SerenityOS/serenity/pull/10581 Reviewed-by: https://github.com/timschumi ✅
1 changed files with 1 additions and 1 deletions
|
@ -16,7 +16,7 @@ __BEGIN_DECLS
|
|||
|
||||
#define EXIT_SUCCESS 0
|
||||
#define EXIT_FAILURE 1
|
||||
#define MB_CUR_MAX 1
|
||||
#define MB_CUR_MAX 4
|
||||
|
||||
__attribute__((malloc)) __attribute__((alloc_size(1))) void* malloc(size_t);
|
||||
__attribute__((malloc)) __attribute__((alloc_size(1, 2))) void* calloc(size_t nmemb, size_t);
|
||||
|
|
Loading…
Add table
Reference in a new issue