From 1004acd1d5256980fffc5f165cb7fc8518b5afc1 Mon Sep 17 00:00:00 2001 From: Ralf Teusner Date: Thu, 1 Mar 2018 16:09:29 +0100 Subject: [PATCH] allow numbers to be passed via std.in (numbers are valid json, but crashed when we tried to access them in a hash way. This is now prevented.) --- app/controllers/submissions_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/submissions_controller.rb b/app/controllers/submissions_controller.rb index 3e24af1c..b6d7052f 100644 --- a/app/controllers/submissions_controller.rb +++ b/app/controllers/submissions_controller.rb @@ -167,7 +167,7 @@ class SubmissionsController < ApplicationController # if the command is 'client_kill', send it to docker otherwise. begin parsed = JSON.parse(data) - if parsed['cmd'] == 'client_kill' + if parsed.class == Hash && parsed['cmd'] == 'client_kill' Rails.logger.debug("Client exited container.") @docker_client.kill_container(result[:container]) else