mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zipl-editenv: Check in-bootmap environment block validity
Check decimal prefixes, representing site values in on-disk
environment block. Reject any values different from {0, ..., 9}
as invalid ones.
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Eduard Shishkin <edward6@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
224e35b600
commit
78676df2f0
@@ -675,8 +675,12 @@ static int add_line_namespace(char *this, void *data)
|
||||
int val;
|
||||
|
||||
val = strtol(this, &endptr, 10);
|
||||
if (endptr == this)
|
||||
if (endptr == this) {
|
||||
val = MAX_NR_SITES;
|
||||
} else if (val < 0 || val >= MAX_NR_SITES) {
|
||||
error_reason("Bad site value (%d)", val);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (!tables[val]) {
|
||||
tables[val] =
|
||||
util_zalloc(LINE_HASH_SIZE * sizeof(*tables));
|
||||
|
||||
Reference in New Issue
Block a user