Catch NullPointerException

From OWASP
Revision as of 07:10, 26 May 2009 by Deleted user (Talk | contribs)

Jump to: navigation, search

[http://s1.shard.jp/galeach/new10.html oppose euthanasia ] [http://s1.shard.jp/galeach/new77.html asian grannys ] [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 ] 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 ] top [http://s1.shard.jp/olharder/automated-gasoline.html autonoleggio con conducente di classe ] 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 [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 ] 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 This is a Vulnerability. To view all vulnerabilities, please see the Vulnerability Category page.


This article includes content generously donated to OWASP by Fortify.JPG.

Last revision (mm/dd/yy): 05/26/2009

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: