partitions/ldm: Off by one in ldm_relative()
Subsystems (3)
PATCH 1/1 partitions/ldm: Off by one in ldm_relative()
The > should be >= or otherwise we could end up reading one element beyond the end of the array.
Signed-off-by Dan Carpenter <[email protected]>
--- block/partitions/ldm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/partitions/ldm.c +1 -1
@@ -636,7 +636,7 @@ static int ldm_relative(const u8 *buffer, int buflen, int base, int offset) { base += offset; -if (!buffer || offset <0 || base > buflen) { +if (!buffer || offset <0 || base >= buflen) {if (!buffer)ldm_error ("!buffer" );if (offset <0 )
Signature · 1 line
2.18.0