1
0
forked from aniani/vim

patch 7.4.1255

Problem:    Crash for channel "eval" command without third argument.
Solution:   Check for missing argument.
This commit is contained in:
Bram Moolenaar
2016-02-03 23:59:43 +01:00
parent 3b05b135e3
commit 66624ff0d9
4 changed files with 16 additions and 4 deletions

View File

@@ -68,8 +68,8 @@ class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler):
# simply send back a string
response = "got it"
elif decoded[1] == 'make change':
# Send two ex commands at the same time, before replying to
# the request.
# Send two ex commands at the same time, before
# replying to the request.
cmd = '["ex","call append(\\"$\\",\\"added1\\")"]'
cmd += '["ex","call append(\\"$\\",\\"added2\\")"]'
print("sending: {}".format(cmd))
@@ -87,6 +87,12 @@ class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler):
print("sending: {}".format(cmd))
self.request.sendall(cmd.encode('utf-8'))
response = "ok"
elif decoded[1] == 'eval-bad':
# Send an eval request missing the third argument.
cmd = '["eval","xxx"]'
print("sending: {}".format(cmd))
self.request.sendall(cmd.encode('utf-8'))
response = "ok"
elif decoded[1] == 'eval-result':
# Send back the last received eval result.
response = last_eval