Skip to content

Commit 835d119

Browse files
committed
Fixed nullRef from trusted user input
1 parent dd9958c commit 835d119

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

MLAPI/NetworkingManagerComponents/Core/InternalMessageHandler.Receive.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ internal static void HandleCommand(uint clientId, BitReader reader, int channelI
307307
MethodInfo targetMethod = null;
308308
if (behaviour.cachedMethods.ContainsKey(hash))
309309
targetMethod = behaviour.cachedMethods[hash];
310-
310+
else return; //No method
311311
ParameterInfo[] parameters = targetMethod.GetParameters();
312312
object[] methodParams = new object[parameters.Length];
313313
for (int i = 0; i < parameters.Length; i++)
@@ -327,6 +327,7 @@ internal static void HandleRpc(uint clientId, BitReader reader, int channelId)
327327
MethodInfo targetMethod = null;
328328
if (behaviour.cachedMethods.ContainsKey(hash))
329329
targetMethod = behaviour.cachedMethods[hash];
330+
else return; //No method
330331
ParameterInfo[] parameters = targetMethod.GetParameters();
331332
object[] methodParams = new object[parameters.Length];
332333
for (int i = 0; i < parameters.Length; i++)
@@ -346,6 +347,7 @@ internal static void HandleTargetRpc(uint clientId, BitReader reader, int channe
346347
MethodInfo targetMethod = null;
347348
if (behaviour.cachedMethods.ContainsKey(hash))
348349
targetMethod = behaviour.cachedMethods[hash];
350+
else return; //No method
349351
ParameterInfo[] parameters = targetMethod.GetParameters();
350352
object[] methodParams = new object[parameters.Length];
351353
for (int i = 0; i < parameters.Length; i++)

0 commit comments

Comments
 (0)