MiscHandler validation

Added more restrictive validation for the "Misc" Handlers.
This commit is contained in:
yankejustin 2015-06-02 18:21:15 -04:00
parent bf5b517eca
commit 81c9b238c8
1 changed files with 4 additions and 1 deletions

View File

@ -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);