From 6715902005644f5b54084910f52103dfb3655682 Mon Sep 17 00:00:00 2001 From: urlbot Date: Mon, 21 Jul 2014 03:51:02 +0200 Subject: [PATCH] fix parse_commands(): check array bounds added --- eventlooper.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eventlooper.py b/eventlooper.py index e59b854..50e837b 100755 --- a/eventlooper.py +++ b/eventlooper.py @@ -75,6 +75,9 @@ def extract_url(data): def parse_commands(data): words = data.split(' ') + if 3 > len(words): # need at least two words + return + # reply if beginning of the text matches bot_user if words[1][0:len(bot_user)] == bot_user: chat_write(words[0][1:-1] + ''': I'm a bot, my job is to extract tags from posted URLs. In case I'm annoying or for further questions, please talk to my master Cae.''')