Skip to content

Commit 5fac8af

Browse files
committed
Checking if an unsigned long is < 0 is pointless.
Found by LLVM/clang 2.9.
1 parent a0b1ff5 commit 5fac8af

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎Modules/mmapmodule.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -645,9 +645,9 @@ mmap_move_method(mmap_object *self, PyObject *args)
645645
return NULL;
646646
} else {
647647
/* bounds check the values */
648-
if (cnt < 0 || (cnt + dest) < cnt || (cnt + src) < cnt ||
649-
src < 0 || src > self->size || (src + cnt) > self->size ||
650-
dest < 0 || dest > self->size || (dest + cnt) > self->size) {
648+
if ((cnt + dest) < cnt || (cnt + src) < cnt ||
649+
src > self->size || (src + cnt) > self->size ||
650+
dest > self->size || (dest + cnt) > self->size) {
651651
PyErr_SetString(PyExc_ValueError,
652652
"source, destination, or count out of range");
653653
return NULL;

0 commit comments

Comments
 (0)