OSDN Git Service

Avoid underflow on an unsigned int when computering bg overrun
authorKen Sumrall <ksumrall@android.com>
Fri, 16 Aug 2013 02:06:29 +0000 (19:06 -0700)
committerKen Sumrall <ksumrall@android.com>
Fri, 16 Aug 2013 02:06:29 +0000 (19:06 -0700)
commit17de65420dbc114001896d243fbb27cc3ba6bf61
treecd1c2176b4b704b5d1361598a96ecf484fb1dcb3
parent5b1efce4aeea83c7b18dfed5d3366d6b84874c23
Avoid underflow on an unsigned int when computering bg overrun

A computation for when a block group overruns the end of an image
was consistently storing a negative number in an unsigned var,
and then checking for >0, which is always true for negative numbers.
So first check if the number will be positive before computing it.

Change-Id: Ic8cff8f9ab9f4ea8c5a4dc42143c2430fa87ba12
ext4_utils/allocate.c