summaryrefslogtreecommitdiff
path: root/cmds-scrub.c
diff options
context:
space:
mode:
authorDimitri John Ledkov <xnox@ubuntu.com>2017-02-13 11:24:33 +0000
committerDimitri John Ledkov <xnox@ubuntu.com>2017-02-13 11:24:33 +0000
commit4305d024938113df5d73021a09eb2a991f54ca2f (patch)
treed9e7ecc9db14bcc1394607a9e6c644a8b93e9bea /cmds-scrub.c
parente693f0e4ffb1776a05b78264ee3d93d5f07efede (diff)
New upstream release Closes: #849353, #817806, #854915, #845473
Diffstat (limited to 'cmds-scrub.c')
-rw-r--r--cmds-scrub.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/cmds-scrub.c b/cmds-scrub.c
index c03bc5fb..2cf7f308 100644
--- a/cmds-scrub.c
+++ b/cmds-scrub.c
@@ -481,7 +481,10 @@ static struct scrub_file_record **scrub_read_file(int fd, int report_errors)
again:
old_avail = avail - i;
- BUG_ON(old_avail < 0);
+ if (old_avail < 0) {
+ error("scrub record file corrupted near byte %d", i);
+ return ERR_PTR(-EINVAL);
+ }
if (old_avail)
memmove(l, l + i, old_avail);
avail = read(fd, l + old_avail, sizeof(l) - old_avail);
@@ -650,7 +653,9 @@ skip:
} while (i < avail);
continue;
}
- BUG();
+ error("internal error: unknown parser state %d near byte %d",
+ state, i);
+ return ERR_PTR(-EINVAL);
}
goto again;
}