• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Android - Information leakage flaw OutputStream

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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();
   }
}
 
Saloon Keeper
Posts: 7582
176
 
nik saraf
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
that was not a correct answer i am still finding suitable answer
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
If you're gonna buy things, buy this thing and I get a fat kickback:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic