This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org

Difference between revisions of "Catch NullPointerException"

From OWASP
Jump to: navigation, search
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
[http://s1.shard.jp/galeach/new10.html oppose euthanasia
+
{{taggedDocument
] [http://s1.shard.jp/galeach/new77.html asian grannys
+
| type=pls review‎
] [http://s1.shard.jp/frhorton/t45lfscw6.html african american day father poem
+
}}
] [http://s1.shard.jp/olharder/autologous-cell.html game auto
+
 
] [http://s1.shard.jp/galeach/new170.html asian garden mall
+
 
] [http://s1.shard.jp/galeach/new124.html asian thong babes
 
] [http://s1.shard.jp/galeach/new194.html asian business directory directory franchising opportunity regional
 
] [http://s1.shard.jp/losaul/australian-momentum.html australian innovation centre
 
] [http://s1.shard.jp/galeach/new164.html canasia toys gifts inc.
 
] [http://s1.shard.jp/galeach/ asian art museum san fran
 
] [http://s1.shard.jp/losaul/epoxy-surfboards.html robert walters recruitment australia
 
] [http://s1.shard.jp/olharder/automobile-get.html automobile get loan] [http://s1.shard.jp/frhorton/5hrrb99yl.html black african descent
 
] [http://s1.shard.jp/bireba/symantec-antivirus.html software for antivirus
 
] [http://s1.shard.jp/bireba/ca-etrust-antivirus.html top rated antivirus/antispyware security software 2006
 
] [http://s1.shard.jp/losaul/why-do-we-have.html australian open live video
 
] [http://s1.shard.jp/olharder/autoroll-654.html top] [http://s1.shard.jp/olharder/automated-gasoline.html autonoleggio con conducente di classe
 
] [http://s1.shard.jp/olharder/autoroll-654.html index] [http://s1.shard.jp/bireba/computer-associates.html i run my antivirus and the computer shuts down
 
] [http://s1.shard.jp/losaul/bmw-australia.html dating agencies australia
 
] [http://s1.shard.jp/bireba/mac-antivirus.html antivirus software downloadable
 
] [http://s1.shard.jp/frhorton/bc7zse5ug.html africa distributor in required south
 
] [http://s1.shard.jp/bireba/imac-intel-antivirus.html antivirus software sales
 
] [http://s1.shard.jp/bireba/avp-antivirus-free.html norton antivirus free download full version
 
] [http://s1.shard.jp/galeach/new156.html big asian jug
 
] [http://s1.shard.jp/olharder/premium-autoboomru.html accident attorney automobile cincinnati injury insurance personal
 
] [http://s1.shard.jp/losaul/australian-sheepskin.html unlocking nokia phones australia
 
] [http://s1.shard.jp/bireba/panda-antivirus.html new antiviruses
 
] [http://s1.shard.jp/olharder/automatic-direction.html grand theft auto san andraes cheats for ps2
 
] [http://s1.shard.jp/olharder/automobile-computer.html dayton ohio auto auction
 
] [http://s1.shard.jp/olharder/sunnyside-auto.html automobile disclosure missouri seller statement
 
] [http://s1.shard.jp/frhorton/dxtxzjkte.html alex african grey videos
 
] [http://s1.shard.jp/frhorton/w2yqtuc7f.html avis cars south africa
 
] [http://s1.shard.jp/olharder/autoroll-654.html http] [http://s1.shard.jp/galeach/new50.html asian ladyboy vids
 
] [http://s1.shard.jp/losaul/job-agencies-sydney.html australia animal picture
 
] [http://s1.shard.jp/bireba/download-free.html simantec antivirus
 
] [http://s1.shard.jp/galeach/new157.html asian sri lanka tsunami
 
] [http://s1.shard.jp/frhorton/cwoxkek8d.html kwela south african pop music
 
] [http://s1.shard.jp/bireba/symantec-antivirus.html winantivirus pro 2005 free download
 
] [http://s1.shard.jp/frhorton/bzsc3x6qn.html african american cute hair prom style
 
] [http://s1.shard.jp/losaul/steel-houses-australia.html australian rain forest
 
] [http://s1.shard.jp/olharder/auto-sales-winnies.html autoritatea rutiera romana
 
] [http://s1.shard.jp/frhorton/64klk5ggy.html celebrity african american music] [http://s1.shard.jp/bireba/symantec-antivirus.html ebay software computers networking and antivirus
 
] [http://s1.shard.jp/olharder/arabian-automobiles.html heavy duty automatic transmissions
 
] [http://s1.shard.jp/galeach/new177.html asian donors egg
 
] [http://s1.shard.jp/bireba/antivirus-free-download.html nod32 antivirus serial
 
] [http://s1.shard.jp/losaul/australia-importing.html australia perth mission
 
 
http://www.textcomongetrict.com
 
 
{{Template:Vulnerability}}
 
{{Template:Vulnerability}}
 
{{Template:Fortify}}
 
{{Template:Fortify}}

Latest revision as of 20:35, 31 August 2015

This page has been tagged and needs review. Please help OWASP and document the reason for this, see FixME.


This is a Vulnerability. To view all vulnerabilities, please see the Vulnerability Category page.

This article includes content generously donated to OWASP by MicroFocus Logo.png

Last revision (mm/dd/yy): 08/31/2015

Vulnerabilities Table of Contents

Description

It is generally a bad practice to catch NullPointerException.

Programmers typically catch NullPointerException under three circumstances:

  1. The program contains a null pointer dereference. Catching the resulting exception was easier than fixing the underlying problem.
  2. The program explicitly throws a NullPointerException to signal an error condition.
  3. The code is part of a test harness that supplies unexpected input to the classes under test.

Of these three circumstances, only the last is acceptable.

Risk Factors

TBD

Examples

The following code mistakenly catches a NullPointerException.

	  try {
		mysteryMethod();
	  }
	  catch (NullPointerException npe) {
	  }

Related Attacks


Related Vulnerabilities


Related Controls


Related Technical Impacts


References

Note: A reference to related CWE or CAPEC article should be added when exists. Eg: