extmod/uzlib: Explicitly cast ptr-diff-expr to unsigned.
The struct member "dest" should never be less than "destStart", so their difference is never negative. Cast as such to make the comparison explicitly unsigned, ensuring the compiler produces the correct comparison instruction, and avoiding any compiler warnings.
This commit is contained in:
parent
300eb65ae7
commit
ed2be79b49
@ -464,7 +464,7 @@ static int tinf_inflate_block_data(TINF_DATA *d, TINF_TREE *lt, TINF_TREE *dt)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* catch trying to point before the start of dest buffer */
|
/* catch trying to point before the start of dest buffer */
|
||||||
if (offs > d->dest - d->destStart) {
|
if (offs > (unsigned int)(d->dest - d->destStart)) {
|
||||||
return TINF_DATA_ERROR;
|
return TINF_DATA_ERROR;
|
||||||
}
|
}
|
||||||
d->lzOff = -offs;
|
d->lzOff = -offs;
|
||||||
|
Loading…
Reference in New Issue
Block a user