[Pki-devel] Patches of Fixes for Coverity Issues for DogTag10 for Review

Ade Lee alee at redhat.com
Mon May 21 15:39:32 UTC 2012


Abhishek, 

Some comments.  In general, when changing some lines of code, please fix
formatting and indentation,remove extra blank lines etc.

Patch 1:
SimpleProperties.java - remove extra blank lines
LdapRequestListener.java - fix indentation, remove extra blank line
GenericPolicyProcessor.java - extra blank line
ExtDataHashtable.java - formatting, also this can be simplified further.  There is no need for the assignment of oKey to key.
CMSProperties.java - extra lines

Patch 2:
ArgBlock.java - this is incorrect.  You still need to create a boolean object.  It should be: return mArgs.put(n, Boolean.valueOf(v));
PKIJNDIRealm.java - same comment here.  Should be: v.addElement(Boolean.valueOf(passed)); in all three cases.
SSLSelfSignedCert.java - change the one that is commented out too.
BasicConstraintsExtension.java  - same problem here. should be : 
return (Boolean.valueOf(ca));
CRLExtensions.java -same problem here.
CertificateExtensions.java - same problem here.
Extensions.java - and here
KeyUsageExtension.java - and here
ReasonFlags.java - and here

Patch 3:
SimpleProperties.java -- formatting.  Should be : 
line = loppedLine + nextLine;
EmailTemplate.java -- formatting and extra line
TestClient.java - this is a pretty dumb function.  Find all instances where this getString() 
function is called and replace with String.valueOf(foo) and remove this function.

ExtendedKeyUsageExtension - this is very confusing.
1. there is no reason to use StringBuffer for presentation.
2. You can just initialize extByteValue in a single step: 
   StringBuffer extByteValue = new StringBuffer(" val=");
3. Remove the commented out lines.

OCSPNoCheckExtension.java - same kinds of comments as above.

Patch 4 and 5:

For these patches, I will make some general comments.  Please check that all of these are addressed and resubmit.

1. avoid unneeded initializations:
 StringBuffer tempBuffer=new StringBuffer();
 tempBuffer.append("");   <-- this line not needed
2. Initialize in a single step if possible.  That is -
   StringBuffer foo = new StringBuffer("bar");
3. If you change a line, remove it rather than commenting out.
4. Avoid unnecessary complication:
tempBuffer.append("(").append(CertRecord.ATTR_META_INFO).append("=profileId:").append(id).append(")");
can be written as:
tempBuffer.append("(" + CertRecord.ATTR_META_INFO + "=profileId:" + id + ")";
5.  Formatting:
      entry .append( ",");  is bad
      entry.append(","); is better -- Note, removal of space in two places.

Please fix all the above and resubmit.  Also, please run the smoke test
as well.

Thanks,
Ade

On Fri, 2012-05-18 at 18:16 -0400, Abhishek Koneru wrote:
> Hello Everyone,
> 
>      PFA review the pathches for fixes done for some of the Coverity
> Issues for DogTag 10.
> 
> Thank you.
> Regards,
> Abhishek Koneru
> _______________________________________________
> Pki-devel mailing list
> Pki-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/pki-devel





More information about the Pki-devel mailing list