Fix chansrv unterminated streams

This commit is contained in:
matt335672 2021-05-18 16:02:35 +01:00
parent 763f8fab7f
commit eda01f0853
2 changed files with 4 additions and 1 deletions

View File

@ -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;
} }

View File

@ -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;
} }