1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +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:
Zdenek Kabelac 2015-11-16 01:04:21 +01:00
parent 193e7f5973
commit c3b292a4a9

View File

@ -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. */
if (alignment_offset &&
if (alignment && alignment_offset &&
(((mda_start + mda_size) % alignment) == 0)) {
tmp_mda_size = mda_size + alignment_offset;
if (mda_start + tmp_mda_size <= limit)