diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2014-04-15 04:14:46 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2014-04-15 04:14:46 -0700 |
commit | 687a2b70a1258f7e9129ecf38c9b91f65d3a6ec8 (patch) | |
tree | e79075b30b4f0e52b043a79dc3d62ecd05a23c99 /dinobot.rb | |
parent | 58cdde4d638270d3ad37e770ece2825ec3613520 (diff) | |
download | dinobot-687a2b70a1258f7e9129ecf38c9b91f65d3a6ec8.tar.gz dinobot-687a2b70a1258f7e9129ecf38c9b91f65d3a6ec8.tar.xz |
Fix memory leaks (don't intern user input).
Diffstat (limited to 'dinobot.rb')
-rw-r--r-- | dinobot.rb | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -78,7 +78,11 @@ module Dinobot def parse_command(user, channel, command, prev=nil) command, remainder = command.split(' | ', 2) - mod = command.scan(/\A\S+/).first.downcase.intern + mod = command.scan(/\A\S+/).first.downcase + + return unless @modules.keys.map { |x| x.to_s }.include?(mod) + + mod = mod.intern if prev.nil? methods = @modules[mod].call(user, channel, command) |