Skip to content
This repository
Browse code

Fixed an exploit. Thanks to xanaboy for finding it.

  • Loading branch information...
commit fe4070cc324bc3a287b3903ac967e5f80fbe97a0 1 parent bec710f
authored July 21, 2012
7  lua/entities/gmod_wire_thruster/init.lua
@@ -118,6 +118,13 @@ function ENT:Setup(force, force_min, force_max, oweffect, uweffect, owater, uwat
118 118
 	self.UWater = uwater
119 119
 
120 120
 	if (!soundname) then soundname = "" end
  121
+	
  122
+	-- Preventing client crashes
  123
+	local BlockedChars = '["?]'
  124
+	if ( string.find(soundname, BlockedChars) ) then
  125
+		self:StopSound( self.SoundName )
  126
+		soundname = ""
  127
+	end
121 128
 
122 129
 	if (soundname == "") then
123 130
 		self:StopSound( self.SoundName )
8  lua/entities/gmod_wire_turret/init.lua
@@ -71,7 +71,13 @@ end
71 71
 
72 72
 -- Sound
73 73
 function ENT:SetSound( str )
74  
-	self.Sound = str
  74
+	-- Preventing client crashes
  75
+	local BlockedChars = '["?]'
  76
+	if ( string.find(str, BlockedChars) ) then
  77
+		self.Sound = ""
  78
+	else
  79
+		self.Sound = str
  80
+	end
75 81
 end
76 82
 function ENT:GetSound()
77 83
 	return self.Sound
7  lua/entities/gmod_wire_vectorthruster/init.lua
@@ -127,6 +127,13 @@ function ENT:Setup(force, force_min, force_max, oweffect, uweffect, owater, uwat
127 127
 	self.BiDir = bidir
128 128
 	self.OWater = owater
129 129
 	self.UWater = uwater
  130
+	
  131
+	-- Preventing client crashes
  132
+	local BlockedChars = '["?]'
  133
+	if ( string.find(soundname, BlockedChars) ) then
  134
+		self:StopSound( self.SoundName )
  135
+		soundname = ""
  136
+	end
130 137
 
131 138
 	if (soundname and soundname == "" and self.SoundName and self.SoundName != "") then
132 139
 		self:StopSound(self.SoundName)

0 notes on commit fe4070c

Please sign in to comment.
Something went wrong with that request. Please try again.