• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Android - Information leakage flaw OutputStream

 
nik saraf
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Android - Information leakage flaw OutputStream

0
down vote
favorite
I have developed an application in the Cordova Framework, and I have added a camera plugin for capture functionality.

I am getting an Information Leakage flaw in the code,
OutputStream os = this.cordova.getActivity().getContentResolver().openOutputStream(uri);
try {
    bitmap.compress(Bitmap.CompressFormat.JPEG, this.mQuality, os);
    os.close();
} finally {
    if (os != null) {
        os.close();
    }
}
 
nik saraf
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that was not a correct answer i am still finding suitable answer
 
Dave Tolls
Ranch Hand
Posts: 2091
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you give us the full text of the error you are getting, and where/what in your code it is being applied to.
If this is not a compiler error or warning and is from some code checking tool then can you tell us what the tool is.

I will say that you have two os.close() calls there, which is is unnecessary.

Also, when using the solution (try-with-resources) given in the StackOverflow thread, what problem do you get?
 
nik saraf
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for reply,
its not an error its warning given by tool called VeraCode after static scan.
And the warning is Information Exposure through sent data
please find full code below ,
warning is giving for line  try (OutputStream os = this.cordova.getActivity().getContentResolver().openOutputStream(uri))


 
Dave Tolls
Ranch Hand
Posts: 2091
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No idea I'm afraid.
I can't see, offhand, why that was cause an issue.
There's no exceptions exposing data, there's only a URI passed into the method...

That method is a monster, by the way!

Hmm, could it be down to the possible exception that could be thrown?  That could leak info since it will get thrown up and out of the method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic