Skip to content
Snippets Groups Projects
Commit 7563b6ea authored by Konstantin Shulgin's avatar Konstantin Shulgin
Browse files

bug899343: review fixes.

parent 0d3e60bf
No related branches found
No related tags found
No related merge requests found
......@@ -28,8 +28,8 @@
#include <tbuf.h> /* for struct tbuf */
enum {
/** Maximal iproto package length (2GiB) */
IPROTO_LEN_MAX = 2147483648,
/** Maximal iproto package body length (2GiB) */
IPROTO_BODY_LEN_MAX = 2147483648,
};
/*
......
......@@ -132,9 +132,12 @@ static void iproto_reply(iproto_callback callback, struct tbuf *request)
static void
iproto_validate_header(struct iproto_header *header)
{
if (header->len > IPROTO_LEN_MAX) {
/* the package has invalid length, close connection */
say_error("Invalid iproto package length: %llu",
if (header->len > IPROTO_BODY_LEN_MAX) {
/*
* The package is too big, just close connection for now to
* avoid DoS.
*/
say_error("received package is too big: %llu",
(unsigned long long)header->len);
tnt_raise(FiberCancelException);
}
......
......@@ -9,13 +9,6 @@
# sending the package with invalid length
12
# checking what is server alive
show stat
---
statistics:
REPLACE: { rps: 0 , total: 0 }
SELECT: { rps: 0 , total: 0 }
UPDATE: { rps: 0 , total: 0 }
DELETE_1_3: { rps: 0 , total: 0 }
DELETE: { rps: 0 , total: 0 }
CALL: { rps: 0 , total: 0 }
...
ping
ok
---
......@@ -21,7 +21,7 @@ print "# sending the package with invalid length"
inval_request = struct.pack('<LLL', 17, 4294967290, 1)
print s.send(inval_request)
print "# checking what is server alive"
exec admin "show stat"
exec sql "ping"
# closing connection
s.close()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment