From b0889b2e44ea28f1ef15d64d37da44b5ff94399d Mon Sep 17 00:00:00 2001 From: damith_samarakoon Date: Tue, 25 Feb 2025 16:52:09 +0530 Subject: [PATCH] Code fixes for CVE-2023-24442 --- .../githubprcoveragestatus/Configuration.java | 63 ++++++++++++------- .../ConfigurationTest.java | 39 ++++++++++++ 2 files changed, 79 insertions(+), 23 deletions(-) create mode 100644 src/test/java/com/github/terma/jenkins/githubprcoveragestatus/ConfigurationTest.java diff --git a/src/main/java/com/github/terma/jenkins/githubprcoveragestatus/Configuration.java b/src/main/java/com/github/terma/jenkins/githubprcoveragestatus/Configuration.java index e8ead18..0a7f382 100644 --- a/src/main/java/com/github/terma/jenkins/githubprcoveragestatus/Configuration.java +++ b/src/main/java/com/github/terma/jenkins/githubprcoveragestatus/Configuration.java @@ -2,19 +2,20 @@ Copyright 2015-2016 Artem Stasiuk -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. */ + package com.github.terma.jenkins.githubprcoveragestatus; import hudson.Extension; @@ -27,12 +28,12 @@ import org.apache.commons.lang.math.NumberUtils; import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.FormException; import edu.umd.cs.findbugs.annotations.NonNull; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -@SuppressWarnings("WeakerAccess") public class Configuration extends AbstractDescribableImpl { @Extension @@ -97,14 +98,14 @@ public static final class ConfigurationDescriptor extends Descriptor