summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-01-10 22:59:44 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-01-11 23:41:41 -0500
commitc5e04d51277994cca29234b33a6b8fc90a183cf3 (patch)
tree6f5072940303d26ab2a3e7bfafeace1cfdb3ecdf /src/shared
parent266fd0eabca6b7f10b013c7e4b5c06adc43e1b73 (diff)
fstab-util: detect out-of-range pri= assignments
We would silently ignore them. One would have to be crazy to do assign an out of range value, but simply ignoring it bothers me.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/fstab-util.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shared/fstab-util.c b/src/shared/fstab-util.c
index 546c81b80f..a886f6a5da 100644
--- a/src/shared/fstab-util.c
+++ b/src/shared/fstab-util.c
@@ -140,6 +140,9 @@ int fstab_find_pri(const char *options, int *ret) {
if (r < 0)
return r;
+ if ((int) pri < 0)
+ return -ERANGE;
+
*ret = (int) r;
return 1;
}