diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-01-10 22:59:44 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-01-11 23:41:41 -0500 |
commit | c5e04d51277994cca29234b33a6b8fc90a183cf3 (patch) | |
tree | 6f5072940303d26ab2a3e7bfafeace1cfdb3ecdf | |
parent | 266fd0eabca6b7f10b013c7e4b5c06adc43e1b73 (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.
-rw-r--r-- | src/shared/fstab-util.c | 3 |
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; } |