From 6f41ca4de14493e50924552554aec6e53dd1b310 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 15 Nov 2017 18:02:01 +0100 Subject: [PATCH] Refine allocation None of currently supported codepages would claim more than 5 bytes per a multibyte glyph, that's (255*5+1)kb, not 2kb anymore. --- win32/readdir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win32/readdir.c b/win32/readdir.c index a3f20f7f3d..146ab54ff5 100644 --- a/win32/readdir.c +++ b/win32/readdir.c @@ -37,7 +37,7 @@ DIR *opendir(const char *dir) return NULL; } - dp = (DIR *) calloc(1, sizeof(DIR) + MAXPATHLEN*sizeof(char)); + dp = (DIR *) calloc(1, sizeof(DIR) + (_MAX_FNAME*5+1)*sizeof(char)); if (dp == NULL) { return NULL; } -- 2.49.0