summaryrefslogtreecommitdiffstats
path: root/base/util
diff options
context:
space:
mode:
authorAbhishek Koneru <akoneru@redhat.com>2012-06-27 14:27:55 -0400
committerEndi Sukma Dewata <edewata@redhat.com>2012-07-02 12:43:57 -0500
commit10502e34a10fb3b672aef1161cc271003c7806ba (patch)
tree4c3c5e8fc8c99759953b52518f78e8ba3100aa17 /base/util
parentd2b06ee1f9fcc42be83f04f64559cfa6317bda67 (diff)
downloadpki-10502e34a10fb3b672aef1161cc271003c7806ba.tar.gz
pki-10502e34a10fb3b672aef1161cc271003c7806ba.tar.xz
pki-10502e34a10fb3b672aef1161cc271003c7806ba.zip
Fixes for Guarded_By_Violation issues shown in Coverity
Diffstat (limited to 'base/util')
-rw-r--r--base/util/src/netscape/security/acl/AclImpl.java8
-rw-r--r--base/util/src/netscape/security/provider/MD5.java4
2 files changed, 8 insertions, 4 deletions
diff --git a/base/util/src/netscape/security/acl/AclImpl.java b/base/util/src/netscape/security/acl/AclImpl.java
index 884304301..9ccb0fc1f 100644
--- a/base/util/src/netscape/security/acl/AclImpl.java
+++ b/base/util/src/netscape/security/acl/AclImpl.java
@@ -370,9 +370,11 @@ final class AclEnumerator implements Enumeration<AclEntry> {
}
public boolean hasMoreElements() {
- return (u1.hasMoreElements() ||
- u2.hasMoreElements() ||
- g1.hasMoreElements() || g2.hasMoreElements());
+ synchronized (acl) {
+ return (u1.hasMoreElements() ||
+ u2.hasMoreElements() ||
+ g1.hasMoreElements() || g2.hasMoreElements());
+ }
}
public AclEntry nextElement() {
diff --git a/base/util/src/netscape/security/provider/MD5.java b/base/util/src/netscape/security/provider/MD5.java
index e64873942..85f9da12d 100644
--- a/base/util/src/netscape/security/provider/MD5.java
+++ b/base/util/src/netscape/security/provider/MD5.java
@@ -230,7 +230,9 @@ public final class MD5 extends MessageDigestSpi implements Cloneable {
public void init() {
state = new int[4];
transformBuffer = new int[16];
- buffer = new byte[64];
+ synchronized (this) {
+ buffer = new byte[64];
+ }
digestBits = new byte[16];
count = 0;
// Load magic initialization constants.