Browse Source

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.
Daniel Bertalan 3 years ago
parent
commit
b3ac24a939
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Userland/Libraries/LibC/stdlib.h

+ 1 - 1
Userland/Libraries/LibC/stdlib.h

@@ -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);