cookies is an array of u_long, not u_int, so MALLOC() it accordingly.

Allocating it with the wrong size could have caused corruption on
64-bit architectures.
This commit is contained in:
Tim J. Robbins 2004-02-23 01:40:46 +00:00
parent 240160d48b
commit 224f219b31
2 changed files with 4 additions and 4 deletions

View File

@ -469,8 +469,8 @@ cd9660_readdir(ap)
* Guess the number of cookies needed.
*/
ncookies = uio->uio_resid / 16;
MALLOC(cookies, u_long *, ncookies * sizeof(u_int), M_TEMP,
M_WAITOK);
MALLOC(cookies, u_long *, ncookies * sizeof(u_long),
M_TEMP, M_WAITOK);
idp->cookies = cookies;
idp->ncookies = ncookies;
}

View File

@ -469,8 +469,8 @@ cd9660_readdir(ap)
* Guess the number of cookies needed.
*/
ncookies = uio->uio_resid / 16;
MALLOC(cookies, u_long *, ncookies * sizeof(u_int), M_TEMP,
M_WAITOK);
MALLOC(cookies, u_long *, ncookies * sizeof(u_long),
M_TEMP, M_WAITOK);
idp->cookies = cookies;
idp->ncookies = ncookies;
}