[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Pki-devel] [PATCH] 001 NPE when modifying profile without 'action' param



This patches 500 Server Error in ProfileService when modifyProfileState
is called without an action query string.

https://fedorahosted.org/pki/ticket/1361
From 668973cf4ed68c54b4e89c4f4f4cf15226e3715d Mon Sep 17 00:00:00 2001
From: Christian Heimes <christian python org>
Date: Fri, 12 Jun 2015 17:13:15 +0200
Subject: [PATCH] NPE when modifying profile without 'action' param

In modifyProfileState check the 'action' query paramter for NULL and
raise a BadRequestException when the paramater is not set.

https://fedorahosted.org/pki/ticket/1361
---
 base/ca/src/org/dogtagpki/server/ca/rest/ProfileService.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/base/ca/src/org/dogtagpki/server/ca/rest/ProfileService.java b/base/ca/src/org/dogtagpki/server/ca/rest/ProfileService.java
index 0e708f4f447dcf3904a2ea9f5daaadb3e2273086..5fffd17cc839972f59b829190da2db57fec3e848 100644
--- a/base/ca/src/org/dogtagpki/server/ca/rest/ProfileService.java
+++ b/base/ca/src/org/dogtagpki/server/ca/rest/ProfileService.java
@@ -388,6 +388,11 @@ public class ProfileService extends PKIService implements ProfileResource {
             throw new BadRequestException("Unable to modify profile state: Invalid Profile Id");
         }
 
+        if (action == null) {
+            CMS.debug("modifyProfileState: invalid request. action is null");
+            throw new BadRequestException("Unable to modify profile state: Invalid action");
+        }
+
         if (ps == null) {
             CMS.debug("modifyProfileState: ps is null");
             throw new PKIException("Error modifying profile state.  Profile Service not available");
-- 
2.4.3

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]