Skip to content
Snippets Groups Projects
Commit b9faf059 authored by Alexandr Lyapunov's avatar Alexandr Lyapunov
Browse files

*) fixed exception-unsafe code:

 on memory fail there could be port->reply.found > 0 and uninitialized port->svp,
 that could lead to random error after svp restoration.
*) possibly fixed OPENTAR-97
parent bc6fe885
No related branches found
No related tags found
No related merge requests found
......@@ -55,10 +55,11 @@ static inline void
iproto_port_add_tuple(struct port *ptr, struct tuple *tuple, uint32_t flags)
{
struct iproto_port *port = iproto_port(ptr);
if (++port->reply.found == 1) {
if (port->reply.found == 0) {
/* Found the first tuple, add header. */
port->svp = obuf_book(port->buf, sizeof(port->reply));
}
port->reply.found++;
if (flags & BOX_RETURN_TUPLE)
tuple_to_obuf(tuple, port->buf);
}
......
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