X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/2d21ac55c334faf3a56e5634905ed6987fc787d4..c910b4d9d2451126ae3917b931cd4390c11e1d52:/osfmk/i386/user_ldt.c diff --git a/osfmk/i386/user_ldt.c b/osfmk/i386/user_ldt.c index 87aab0426..e06afda78 100644 --- a/osfmk/i386/user_ldt.c +++ b/osfmk/i386/user_ldt.c @@ -152,7 +152,7 @@ i386_set_ldt( start_sel = LDTSZ_MIN; } - if (start_sel + num_sels > LDTSZ) { + if ((uint64_t)start_sel + (uint64_t)num_sels > LDTSZ) { task_unlock(task); return ENOMEM; } @@ -294,7 +294,7 @@ i386_get_ldt( if (start_sel >= 8192) return EINVAL; - if (start_sel + num_sels > 8192) + if ((uint64_t)start_sel + (uint64_t)num_sels > 8192) return EINVAL; if (descs == 0) return EINVAL;