From 66838d88e1b0b26aff727ae9aa966289115b4a31 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Mon, 14 Feb 2022 22:21:28 +0800 Subject: [PATCH] Validate PhysicsDirectSpaceState{2,3}D::_intersect_point input --- servers/physics_server_2d.cpp | 2 ++ servers/physics_server_3d.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/servers/physics_server_2d.cpp b/servers/physics_server_2d.cpp index d8f2a2a7802..45816e32447 100644 --- a/servers/physics_server_2d.cpp +++ b/servers/physics_server_2d.cpp @@ -336,6 +336,8 @@ Dictionary PhysicsDirectSpaceState2D::_intersect_ray(const Ref &p_point_query, int p_max_results) { + ERR_FAIL_COND_V(p_point_query.is_null(), Array()); + Vector ret; ret.resize(p_max_results); diff --git a/servers/physics_server_3d.cpp b/servers/physics_server_3d.cpp index 8fafd07f874..fc119e49e9c 100644 --- a/servers/physics_server_3d.cpp +++ b/servers/physics_server_3d.cpp @@ -339,6 +339,8 @@ Dictionary PhysicsDirectSpaceState3D::_intersect_ray(const Ref &p_point_query, int p_max_results) { + ERR_FAIL_COND_V(p_point_query.is_null(), Array()); + Vector ret; ret.resize(p_max_results);