Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

Commit b0a445b

Browse files
authored
Merge pull request #122 from haitaohuang/master
Fix signed integer overflow on shift
2 parents bf768a4 + 0a6d266 commit b0a445b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sgx_encl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ static u32 sgx_calc_ssaframesize(u32 miscselect, u64 xfrm)
339339
int i;
340340

341341
for (i = 2; i < 64; i++) {
342-
if (!((1 << i) & xfrm))
342+
if (!((1UL << i) & xfrm))
343343
continue;
344344

345345
size = SGX_SSA_GPRS_SIZE + sgx_xsave_size_tbl[i];

0 commit comments

Comments
 (0)