findepi / azouk-libraries

Automatically exported from code.google.com/p/azouk-libraries
0 stars 0 forks source link

server crashes on invalid input frame #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. start the server on local port 1980
2. in a Python interpreter run (the below is a valid welcome message
encoded with invalid header (ie. big endian):

{{{
>>> s = socket.socket()
>>> s.connect(('localhost', 1980))
>>>
s.sendall("\x00\x00\x00'\r<QL\x08X\x0c3;\x0cco]h\x01\x10e@Vy(w.6\x0c\x01
\x02*\r\x08j\x10e@Vy(w.6\x0c\x01")
}}}

Server crashes printing

{{{
[DEBUG]  ts=1243691337  pid=16961  ctx=ubtop.mxcontrol.run_multiplexer 
flw=""  txt="starting Connection 0x81c8ae0" 
from=./multiplexer/io/Connection.h:113
./multiplexer/io/RawMessage.h:88: `(contents_.empty() && !length_) ||
length_ == contents_.size()' failed in size_t
multiplexer::RawMessage::get_body_length() const
[DEBUG]  ts=1243691339  pid=16961  ctx=ubtop.mxcontrol.run_multiplexer 
flw=""  txt="destroying Connection 0x81a8a58" 
from=./multiplexer/io/Connection.h:96
[DEBUG]  ts=1243691339  pid=16961  ctx=ubtop.mxcontrol.run_multiplexer 
flw=""  txt="shutdown called on 0x81a8a58" 
from=./multiplexer/io/Connection.h:141
terminate called after throwing an instance of 'asio::system_error'
  what():  Bad file descriptor
Aborted
}}}

Original issue reported on code.google.com by piotr.fi...@gmail.com on 30 May 2009 at 1:49

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Also, server does not handle MultiplexerMessages with all-defaults, e.g. with
RawMessages of the form '\x00' * 8:

{{{
>>> s = socket.socket()
>>> s.connect(('localhost', 1980))
>>> s.sendall("\x00" * 8)
}}}

In this case it fails with (debugging disabled):

{{{
multiplexer/io/RawMessage.cc:63: You can't verify partial message.:
`!contents_.empty()' failed in bool multiplexer::RawMessage::verify()
boost::system::system_error: Bad file descriptor
azlib::signals::exit_signal called: exiting with 1
}}}

Original comment by piotr.fi...@gmail.com on 4 Jul 2009 at 1:10