mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
For big-endian version of getulong() macro, cast result to u_int32_t.
This macro was written expecting a 32-bit unsigned long, and doesn't work properly on 64-bit systems. This bug caused vn_stat() to return incorrect values for files larger than 2gb on msdosfs filesystems on 64-bit systems. PR: 106703 Submitted by: Axel Gonzalez <loox e-shell net> MFC after: 3 days
This commit is contained in:
parent
d01e83878b
commit
3244bb8a12
1 changed files with 1 additions and 1 deletions
|
|
@ -101,7 +101,7 @@ struct bpb710 {
|
|||
#define putulong(p, v) (*((u_int32_t *)(p)) = (v))
|
||||
#else
|
||||
#define getushort(x) (((u_int8_t *)(x))[0] + (((u_int8_t *)(x))[1] << 8))
|
||||
#define getulong(x) (((u_int8_t *)(x))[0] + (((u_int8_t *)(x))[1] << 8) \
|
||||
#define getulong(x) (u_int32_t)(((u_int8_t *)(x))[0] + (((u_int8_t *)(x))[1] << 8) \
|
||||
+ (((u_int8_t *)(x))[2] << 16) \
|
||||
+ (((u_int8_t *)(x))[3] << 24))
|
||||
#define putushort(p, v) (((u_int8_t *)(p))[0] = (v), \
|
||||
|
|
|
|||
Loading…
Reference in a new issue