diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2015-11-16 01:04:21 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2015-11-16 01:16:11 +0100 |
commit | c3b292a4a9924d00da421d66d8281f8cd8efc3a9 (patch) | |
tree | 6f84222abdd64cd6a5933fe25383f98ce674cdd0 | |
parent | 193e7f5973e8a0ff7a4f8ebc542fcb9853a30d0d (diff) | |
download | lvm2-c3b292a4a9924d00da421d66d8281f8cd8efc3a9.tar.gz |
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.
-rw-r--r-- | lib/format_text/format-text.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c index d4f2c89fb..58d6209c7 100644 --- a/lib/format_text/format-text.c +++ b/lib/format_text/format-text.c @@ -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) |