From 81c9b238c8e1d3c383404a5031c30b64167be7ef Mon Sep 17 00:00:00 2001 From: yankejustin Date: Tue, 2 Jun 2015 18:21:15 -0400 Subject: [PATCH] MiscHandler validation Added more restrictive validation for the "Misc" Handlers. --- Server/Core/Commands/MiscHandler.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Server/Core/Commands/MiscHandler.cs b/Server/Core/Commands/MiscHandler.cs index 33f8c889..963f177d 100644 --- a/Server/Core/Commands/MiscHandler.cs +++ b/Server/Core/Commands/MiscHandler.cs @@ -11,7 +11,7 @@ public static partial class CommandHandler { public static void HandleShellCommandResponse(Client client, ShellCommandResponse packet) { - if (client.Value.FrmRs == null) + if (client.Value.FrmRs == null || string.IsNullOrEmpty(packet.Output)) return; if (packet.IsError) @@ -22,6 +22,9 @@ public static void HandleShellCommandResponse(Client client, ShellCommandRespons public static void HandleDownloadFileResponse(Client client, DownloadFileResponse packet) { + if (string.IsNullOrEmpty(packet.Filename)) + return; + if (!Directory.Exists(client.Value.DownloadDirectory)) Directory.CreateDirectory(client.Value.DownloadDirectory);