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:
parent
240160d48b
commit
224f219b31
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user