mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-18 10:04:20 +03:00
format-text: ensure no division by zero
Coverity likes here to be 100% sure no division by zero is possible. Add check for alignment !=0 which is made on other code paths here.
This commit is contained in:
parent
193e7f5973
commit
c3b292a4a9
@ -2119,7 +2119,7 @@ static int _text_pv_add_metadata_area(const struct format_type *fmt,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Align MDA0 end position with given alignment offset if possible. */
|
/* Align MDA0 end position with given alignment offset if possible. */
|
||||||
if (alignment_offset &&
|
if (alignment && alignment_offset &&
|
||||||
(((mda_start + mda_size) % alignment) == 0)) {
|
(((mda_start + mda_size) % alignment) == 0)) {
|
||||||
tmp_mda_size = mda_size + alignment_offset;
|
tmp_mda_size = mda_size + alignment_offset;
|
||||||
if (mda_start + tmp_mda_size <= limit)
|
if (mda_start + tmp_mda_size <= limit)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user