summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-04-02 13:07:55 +0200
committerGitHub <noreply@github.com>2020-04-02 13:07:55 +0200
commit5f11e1557156617366d2c316a97716172103980d (patch)
tree288d8275067df46a8fc58e99184c74955de39bd8 /modules
parent7341a8fe1df65dc4d36aa49938575b6099764c0a (diff)
parent359bebd8c08a626e64ade1ac45c3c925352bd8a4 (diff)
Merge pull request #37504 from qarmin/out_of_bound_cursor
Fix array out of bounds access caused by uninitialised variables
Diffstat (limited to 'modules')
-rw-r--r--modules/bullet/btRayShape.cpp1
-rw-r--r--modules/bullet/generic_6dof_joint_bullet.cpp6
-rw-r--r--modules/gdnative/videodecoder/video_stream_gdnative.h2
-rw-r--r--modules/webrtc/webrtc_multiplayer.cpp1
4 files changed, 9 insertions, 1 deletions
diff --git a/modules/bullet/btRayShape.cpp b/modules/bullet/btRayShape.cpp
index 4071723a3e..0f54f848dc 100644
--- a/modules/bullet/btRayShape.cpp
+++ b/modules/bullet/btRayShape.cpp
@@ -43,6 +43,7 @@ btRayShape::btRayShape(btScalar length) :
m_shapeAxis(0, 0, 1) {
m_shapeType = CUSTOM_CONVEX_SHAPE_TYPE;
setLength(length);
+ slipsOnSlope = false;
}
btRayShape::~btRayShape() {
diff --git a/modules/bullet/generic_6dof_joint_bullet.cpp b/modules/bullet/generic_6dof_joint_bullet.cpp
index a6a01ebaa8..638944df76 100644
--- a/modules/bullet/generic_6dof_joint_bullet.cpp
+++ b/modules/bullet/generic_6dof_joint_bullet.cpp
@@ -43,6 +43,12 @@
Generic6DOFJointBullet::Generic6DOFJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameInA, const Transform &frameInB) :
JointBullet() {
+ for (int i = 0; i < 3; i++) {
+ for (int j = 0; j < PhysicsServer3D::G6DOF_JOINT_FLAG_MAX; j++) {
+ flags[i][j] = false;
+ }
+ }
+
Transform scaled_AFrame(frameInA.scaled(rbA->get_body_scale()));
scaled_AFrame.basis.rotref_posscale_decomposition(scaled_AFrame.basis);
diff --git a/modules/gdnative/videodecoder/video_stream_gdnative.h b/modules/gdnative/videodecoder/video_stream_gdnative.h
index 21b5245a16..8eef6f9098 100644
--- a/modules/gdnative/videodecoder/video_stream_gdnative.h
+++ b/modules/gdnative/videodecoder/video_stream_gdnative.h
@@ -194,7 +194,7 @@ public:
virtual void set_audio_track(int p_track);
virtual Ref<VideoStreamPlayback> instance_playback();
- VideoStreamGDNative() {}
+ VideoStreamGDNative() { audio_track = 0; }
};
class ResourceFormatLoaderVideoStreamGDNative : public ResourceFormatLoader {
diff --git a/modules/webrtc/webrtc_multiplayer.cpp b/modules/webrtc/webrtc_multiplayer.cpp
index c24ae3468f..216eaf1ca3 100644
--- a/modules/webrtc/webrtc_multiplayer.cpp
+++ b/modules/webrtc/webrtc_multiplayer.cpp
@@ -371,6 +371,7 @@ WebRTCMultiplayer::WebRTCMultiplayer() {
unique_id = 0;
next_packet_peer = 0;
target_peer = 0;
+ client_count = 0;
transfer_mode = TRANSFER_MODE_RELIABLE;
refuse_connections = false;
connection_status = CONNECTION_DISCONNECTED;