com php-src: Refine allocation: win32/readdir.c

From: Date: Wed, 15 Nov 2017 17:02:01 +0000
Subject: com php-src: Refine allocation: win32/readdir.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-100263@lists.php.net to get a copy of this message
Commit: 6f41ca4de14493e50924552554aec6e53dd1b310 Author: Anatol Belski <ab@php.net> Wed, 15 Nov 2017 18:02:01 +0100 Parents: 4764574910ee3ccf80b823ff9f07ecbb631f78d8 Branches: PHP-7.2 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6f41ca4de14493e50924552554aec6e53dd1b310 Log: 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. Changed paths: M win32/readdir.c Diff: diff --git a/win32/readdir.c b/win32/readdir.c index a3f20f7..146ab54 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; }

« previous php.cvs (#100263) next »