Bugzilla Bug 326168: fixed an allocation size bug. The patch is

contributed by neil@parkwaycc.co.uk. r=wtc.
This commit is contained in:
wtchang%redhat.com 2006-04-12 00:33:06 +00:00
parent 00757ea341
commit ebb4a334e0

View File

@ -835,7 +835,7 @@ pr_LoadLibraryByPathname(const char *name, PRIntn flags)
} else {
int wlen = MultiByteToWideChar(CP_ACP, 0, name, -1, NULL, 0);
if (wlen > MAX_PATH)
wname = wname_malloc = PR_Malloc(wlen);
wname = wname_malloc = PR_Malloc(wlen * sizeof(PRUnichar));
if (wname == NULL ||
!MultiByteToWideChar(CP_ACP, 0, name, -1, wname, wlen)) {
oserr = _MD_ERRNO();