mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Better bot error-handling, buffer overflow prevention in nudge client.
This commit is contained in:
@@ -18,6 +18,10 @@ def pack(host, port, key, server_id, channel, message):
|
||||
for in_data in message: # The rest of the arguments is data
|
||||
d += [ht.unescape(in_data)]
|
||||
data['data'] = ' '.join(d)
|
||||
|
||||
# Buffer overflow prevention.
|
||||
if len(data['data']) > 400:
|
||||
data['data'] = data['data'][:400]
|
||||
except:
|
||||
data['data'] = "NO DATA SPECIFIED"
|
||||
pickled = pickle.dumps(data)
|
||||
|
||||
Reference in New Issue
Block a user