erofs-utils: lib: fix off-by-one issue with invalid device ID
authorGao Xiang <hsiangkao@linux.alibaba.com>
Tue, 17 Sep 2024 09:11:15 +0000 (17:11 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Tue, 17 Sep 2024 09:26:10 +0000 (17:26 +0800)
commit8ef51b0474b66b9dfbadf487700d8a45f2a65d71
tree47e16237ec6c323edf2ad63767f37efd6403802d
parentc9d13cee3f5b255a9d2030e62c6c910c956f6f75
erofs-utils: lib: fix off-by-one issue with invalid device ID

The device ID should be no less than `1 + number of blobs`. In other
words, it should be greater than `number of blobs`.

Fixes: 89dfe997c2ee ("erofs-utils: lib: fix global-buffer-overflow due to invalid device")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20240917091115.3920734-1-hsiangkao@linux.alibaba.com
lib/io.c