diff options
author | Justin Clark-Casey (justincc) | 2013-02-14 00:19:28 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-02-14 00:20:23 +0000 |
commit | 69d0e168fb2b945ffcd1fb005abd0192d1eb8876 (patch) | |
tree | 3b5fc4966765fcafe3e33b3f0bc1bfc0bb35fa7c /OpenSim/Region/ScriptEngine/Shared | |
parent | Adds a couple requested functions to the JsonStore script (diff) | |
download | opensim-SC_OLD-69d0e168fb2b945ffcd1fb005abd0192d1eb8876.zip opensim-SC_OLD-69d0e168fb2b945ffcd1fb005abd0192d1eb8876.tar.gz opensim-SC_OLD-69d0e168fb2b945ffcd1fb005abd0192d1eb8876.tar.bz2 opensim-SC_OLD-69d0e168fb2b945ffcd1fb005abd0192d1eb8876.tar.xz |
Fix a very unlikely-to-occur NullReferenceException race condition in llPushObject() where the code assumed that the physics actor it null-checked would still be null when it invoked a method on it
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index be6ac0a..96f650e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -4479,6 +4479,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4479 | } | 4479 | } |
4480 | } | 4480 | } |
4481 | } | 4481 | } |
4482 | |||
4482 | if (pushAllowed) | 4483 | if (pushAllowed) |
4483 | { | 4484 | { |
4484 | float distance = (PusheePos - m_host.AbsolutePosition).Length(); | 4485 | float distance = (PusheePos - m_host.AbsolutePosition).Length(); |
@@ -4507,17 +4508,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4507 | applied_linear_impulse *= scaling_factor; | 4508 | applied_linear_impulse *= scaling_factor; |
4508 | 4509 | ||
4509 | } | 4510 | } |
4511 | |||
4510 | if (pusheeIsAvatar) | 4512 | if (pusheeIsAvatar) |
4511 | { | 4513 | { |
4512 | if (pusheeav != null) | 4514 | if (pusheeav != null) |
4513 | { | 4515 | { |
4514 | if (pusheeav.PhysicsActor != null) | 4516 | PhysicsActor pa = pusheeav.PhysicsActor; |
4517 | |||
4518 | if (pa != null) | ||
4515 | { | 4519 | { |
4516 | if (local != 0) | 4520 | if (local != 0) |
4517 | { | 4521 | { |
4518 | applied_linear_impulse *= m_host.GetWorldRotation(); | 4522 | applied_linear_impulse *= m_host.GetWorldRotation(); |
4519 | } | 4523 | } |
4520 | pusheeav.PhysicsActor.AddForce(applied_linear_impulse, true); | 4524 | |
4525 | pa.AddForce(applied_linear_impulse, true); | ||
4521 | } | 4526 | } |
4522 | } | 4527 | } |
4523 | } | 4528 | } |