1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-18 06:04:06 +03:00

librpc/rpc: let dcerpc_read_ncacn_packet_next_vector() handle fragments without any payload

DCERPC_PKT_CO_CANCEL and DCERPC_PKT_ORPHANED don't have any payload by
default. In order to receive them via dcerpc_read_ncacn_packet_send/recv
we need to allow fragments with frag_len == DCERPC_NCACN_PAYLOAD_OFFSET.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15446

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 5c724a3e156ae734e4d187bf9639d895bb011834)
This commit is contained in:
Stefan Metzmacher 2023-08-07 16:16:27 +02:00 committed by Jule Anger
parent f2604db12b
commit 30f317cfb0

View File

@ -565,9 +565,14 @@ static int dcerpc_read_ncacn_packet_next_vector(struct tstream_context *stream,
ofs = state->buffer.length;
if (frag_len < ofs) {
if (frag_len <= ofs) {
/*
* something is wrong, let the caller deal with it
* With frag_len == ofs, we are done, this is likely
* a DCERPC_PKT_CO_CANCEL and DCERPC_PKT_ORPHANED
* without any payload.
*
* Otherwise it's a broken packet and we
* let the caller deal with it.
*/
*_vector = NULL;
*_count = 0;