aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--storeio/dev.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/storeio/dev.c b/storeio/dev.c
index 8bdfa111..c229f37b 100644
--- a/storeio/dev.c
+++ b/storeio/dev.c
@@ -87,6 +87,14 @@ dev_buf_fill (struct dev *dev, off_t offs)
if (err)
return err;
+ if (buf_len < store->block_size)
+ {
+ /* Short read, translate this to EIO */
+ if (buf != dev->buf)
+ munmap (buf, buf_len);
+ return EIO;
+ }
+
if (buf != dev->buf)
{
munmap (dev->buf, store->block_size);