mirror of https://github.com/neutrinolabs/xrdp
Fix chansrv unterminated streams
This commit is contained in:
parent
763f8fab7f
commit
eda01f0853
|
@ -46,6 +46,7 @@ read_entire_packet(struct stream *src, struct stream **dest, int chan_flags,
|
||||||
/* packet not fragmented */
|
/* packet not fragmented */
|
||||||
xstream_new(ls, total_length);
|
xstream_new(ls, total_length);
|
||||||
xstream_copyin(ls, src->p, length);
|
xstream_copyin(ls, src->p, length);
|
||||||
|
s_mark_end(ls);
|
||||||
ls->p = ls->data;
|
ls->p = ls->data;
|
||||||
*dest = ls;
|
*dest = ls;
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -67,7 +68,8 @@ read_entire_packet(struct stream *src, struct stream **dest, int chan_flags,
|
||||||
/* in last packet, chan_flags & 0x02 will be true */
|
/* in last packet, chan_flags & 0x02 will be true */
|
||||||
if (chan_flags & 0x02)
|
if (chan_flags & 0x02)
|
||||||
{
|
{
|
||||||
/* rewind stream */
|
/* terminate and rewind stream */
|
||||||
|
s_mark_end(ls);
|
||||||
ls->p = ls->data;
|
ls->p = ls->data;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -317,6 +317,7 @@ devredir_data_in(struct stream *s, int chan_id, int chan_flags, int length,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s_mark_end(g_input_stream);
|
||||||
g_input_stream->p = g_input_stream->data;
|
g_input_stream->p = g_input_stream->data;
|
||||||
ls = g_input_stream;
|
ls = g_input_stream;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue