summaryrefslogtreecommitdiffstats
path: root/base/common/src/com/netscape/cmscore/dbs/KeyRepository.java
diff options
context:
space:
mode:
authorAbhishek Koneru <akoneru@redhat.com>2012-06-06 16:55:54 -0400
committerEndi Sukma Dewata <edewata@redhat.com>2012-06-14 17:14:19 -0500
commitc53ca291e21761f1de5417ef596afba395a7f5d1 (patch)
tree47a0cd8ecd9d36d414d9230282704e9f784d0a71 /base/common/src/com/netscape/cmscore/dbs/KeyRepository.java
parent084a8cd360c7508febde06415d727d7d247b16ad (diff)
downloadpki-c53ca291e21761f1de5417ef596afba395a7f5d1.tar.gz
pki-c53ca291e21761f1de5417ef596afba395a7f5d1.tar.xz
pki-c53ca291e21761f1de5417ef596afba395a7f5d1.zip
Fixes for NULL_RETURNS Coverity Issues - Part 2
Diffstat (limited to 'base/common/src/com/netscape/cmscore/dbs/KeyRepository.java')
-rw-r--r--base/common/src/com/netscape/cmscore/dbs/KeyRepository.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/base/common/src/com/netscape/cmscore/dbs/KeyRepository.java b/base/common/src/com/netscape/cmscore/dbs/KeyRepository.java
index 726746627..0fbff688a 100644
--- a/base/common/src/com/netscape/cmscore/dbs/KeyRepository.java
+++ b/base/common/src/com/netscape/cmscore/dbs/KeyRepository.java
@@ -251,6 +251,9 @@ public class KeyRepository extends Repository implements IKeyRepository {
*/
public IKeyRecord readKeyRecord(BigInteger serialNo)
throws EBaseException {
+ if (serialNo == null) {
+ throw new EBaseException("Invalid Serial Number.");
+ }
IDBSSession s = mDBService.createSession();
KeyRecord rec = null;
@@ -264,6 +267,9 @@ public class KeyRepository extends Repository implements IKeyRepository {
if (s != null)
s.close();
}
+ if (rec == null) {
+ throw new EBaseException("Failed to recover Key for Serial Number " + serialNo);
+ }
return rec;
}