daandemeyer / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
4bff0a
From ebe93460ef5ae3744c4b627361f4dc5815cffc13 Mon Sep 17 00:00:00 2001
4bff0a
From: Jan Synacek <jsynacek@redhat.com>
4bff0a
Date: Wed, 31 Jul 2019 09:13:41 +0200
4bff0a
Subject: [PATCH] analyze-security: fix potential division by zero
4bff0a
4bff0a
Upstream PR: https://github.com/systemd/systemd/pull/13238
4bff0a
4bff0a
Resolves: #1734400
4bff0a
---
4bff0a
 src/analyze/analyze-security.c | 2 ++
4bff0a
 1 file changed, 2 insertions(+)
4bff0a
4bff0a
diff --git a/src/analyze/analyze-security.c b/src/analyze/analyze-security.c
4bff0a
index 541fc0d97a..eec040d5c3 100644
4bff0a
--- a/src/analyze/analyze-security.c
4bff0a
+++ b/src/analyze/analyze-security.c
4bff0a
@@ -1494,6 +1494,8 @@ static int assess(const struct security_info *info, Table *overview_table, Analy
4bff0a
                 }
4bff0a
         }
4bff0a
 
4bff0a
+        assert(weight_sum > 0);
4bff0a
+
4bff0a
         if (details_table) {
4bff0a
                 size_t row;
4bff0a