Skip to content

Commit

Permalink
MiscHandler validation
Browse files Browse the repository at this point in the history
Added more restrictive validation for the "Misc" Handlers.
  • Loading branch information
yankejustin committed Jun 2, 2015
1 parent bf5b517 commit 81c9b23
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Server/Core/Commands/MiscHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);

Expand Down

0 comments on commit 81c9b23

Please sign in to comment.