analyze-security: fix potential division by zero v239-17 v239-18
authorJan Synacek <jsynacek@redhat.com>
Wed, 31 Jul 2019 07:13:41 +0000 (09:13 +0200)
committerThe Plumber <50238977+systemd-rhel-bot@users.noreply.github.com>
Wed, 7 Aug 2019 12:20:46 +0000 (14:20 +0200)
Upstream PR: https://github.com/systemd/systemd/pull/13238

Resolves: #1734400

src/analyze/analyze-security.c

index 541fc0d97ace79586d44d61fe676ef2e7c05573e..eec040d5c3b8c5de1dae475a5e14e67d68a693ab 100644 (file)
@@ -1494,6 +1494,8 @@ static int assess(const struct security_info *info, Table *overview_table, Analy
                 }
         }
 
+        assert(weight_sum > 0);
+
         if (details_table) {
                 size_t row;