mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Checking if an unsigned long is < 0 is pointless.
Found by LLVM/clang 2.9.
This commit is contained in:
parent
a0b1ff5844
commit
5fac8af22c
1 changed files with 3 additions and 3 deletions
|
@ -645,9 +645,9 @@ mmap_move_method(mmap_object *self, PyObject *args)
|
|||
return NULL;
|
||||
} else {
|
||||
/* bounds check the values */
|
||||
if (cnt < 0 || (cnt + dest) < cnt || (cnt + src) < cnt ||
|
||||
src < 0 || src > self->size || (src + cnt) > self->size ||
|
||||
dest < 0 || dest > self->size || (dest + cnt) > self->size) {
|
||||
if ((cnt + dest) < cnt || (cnt + src) < cnt ||
|
||||
src > self->size || (src + cnt) > self->size ||
|
||||
dest > self->size || (dest + cnt) > self->size) {
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
"source, destination, or count out of range");
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue