Skip to content

Commit

Permalink
Fix chansrv unterminated streams
Browse files Browse the repository at this point in the history
  • Loading branch information
matt335672 committed May 28, 2021
1 parent 763f8fa commit eda01f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sesman/chansrv/chansrv_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ read_entire_packet(struct stream *src, struct stream **dest, int chan_flags,
/* packet not fragmented */
xstream_new(ls, total_length);
xstream_copyin(ls, src->p, length);
s_mark_end(ls);
ls->p = ls->data;
*dest = ls;
return 1;
Expand All @@ -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 */
if (chan_flags & 0x02)
{
/* rewind stream */
/* terminate and rewind stream */
s_mark_end(ls);
ls->p = ls->data;
return 1;
}
Expand Down
1 change: 1 addition & 0 deletions sesman/chansrv/devredir.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ devredir_data_in(struct stream *s, int chan_id, int chan_flags, int length,
return 0;
}

s_mark_end(g_input_stream);
g_input_stream->p = g_input_stream->data;
ls = g_input_stream;
}
Expand Down

0 comments on commit eda01f0

Please sign in to comment.