mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
libdm: fix string boundary
The test for string 'end' needs to account for ending \0, which also needs to fit <SIZE.
This commit is contained in:
parent
eccc91f9b0
commit
6d6e063a0f
@ -1,5 +1,6 @@
|
|||||||
Version 1.02.118 -
|
Version 1.02.118 -
|
||||||
=====================================
|
=====================================
|
||||||
|
Fix string boundary check in _get_canonical_field_name().
|
||||||
Always initialized hist struct in _stats_parse_histogram().
|
Always initialized hist struct in _stats_parse_histogram().
|
||||||
|
|
||||||
Version 1.02.117 - 21st February 2016
|
Version 1.02.117 - 21st February 2016
|
||||||
|
@ -839,8 +839,9 @@ static int _get_canonical_field_name(const char *field,
|
|||||||
diff = 1;
|
diff = 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (i >= fcanonical_len) {
|
if ((i + 1) >= fcanonical_len) {
|
||||||
log_error("%s: field name too long", field);
|
canonical_field[0] = '\0';
|
||||||
|
log_error("%s: field name too long.", field);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
canonical_field[i++] = *field;
|
canonical_field[i++] = *field;
|
||||||
|
Loading…
Reference in New Issue
Block a user