diff options
author | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2018-07-10 21:43:31 +0200 |
---|---|---|
committer | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2018-07-10 21:56:25 +0200 |
commit | b9636f489ce98899a68980296238732a2ac5dc88 (patch) | |
tree | d2c70710852f993967a2d94eb14cef8caa0a135b /parsenfsfh.c | |
parent | c106fba2d71f4e32259f54e8f858858d585f0715 (diff) | |
download | tcpdump-b9636f489ce98899a68980296238732a2ac5dc88.tar.gz |
Fix an undefined behavior at runtime in parsenfsfh.c
The error was:
parsenfsfh.c:359:37: runtime error: left shift of 170 by 24 places cannot
be represented in type 'int'
Diffstat (limited to 'parsenfsfh.c')
-rw-r--r-- | parsenfsfh.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/parsenfsfh.c b/parsenfsfh.c index 06896cd1..79648abe 100644 --- a/parsenfsfh.c +++ b/parsenfsfh.c @@ -356,8 +356,8 @@ Parse_fh(const unsigned char *fh, u_int len, my_fsid *fsidp, } /* VMS file ID is: (RVN, FidHi, FidLo) */ - *inop = (EXTRACT_U_1(fhp + 26) << 24) | - (EXTRACT_U_1(fhp + 27) << 16) | + *inop = (((uint32_t)EXTRACT_U_1(fhp + 26)) << 24) | + (((uint32_t)EXTRACT_U_1(fhp + 27)) << 16) | (EXTRACT_LE_U_2(fhp + 22) << 0); /* Caller must save (and null-terminate?) this value */ |