From f95fc2e73d5149be2b728925452beccad1ea8cda Mon Sep 17 00:00:00 2001 From: David Howells Date: Fri, 11 Apr 2014 23:57:53 +0100 Subject: [PATCH] rxgen: The string and bytes decode functions must advance the cursor The string and bytes decode functions (py_dec_string() and rxrpc_dec_bytes()) need to advance the extraction cursor after extracting so the data doesn't get reused. Signed-off-by: David Howells --- af_rxrpc.c | 1 + py_rxgen.c | 1 + 2 files changed, 2 insertions(+) diff --git a/af_rxrpc.c b/af_rxrpc.c index 9966994..4dce64b 100644 --- a/af_rxrpc.c +++ b/af_rxrpc.c @@ -1054,6 +1054,7 @@ void rxrpc_dec_bytes(struct rx_call *call) count = needed; memcpy(call->bulk_item + call->bulk_index, call->data_cursor, count); call->bulk_index += count; + call->data_cursor += count; if (call->bulk_index >= call->bulk_count) return; } diff --git a/py_rxgen.c b/py_rxgen.c index acdfa9b..6a261d2 100644 --- a/py_rxgen.c +++ b/py_rxgen.c @@ -704,6 +704,7 @@ void py_dec_string(struct rx_call *call) count = needed; memcpy(PyUnicode_DATA(str) + call->bulk_index, call->data_cursor, count); call->bulk_index += count; + call->data_cursor += count; rxrpc_dec_align(call); if (call->bulk_count <= call->bulk_index) return; -- 2.49.0