From: David Howells Date: Fri, 11 Apr 2014 22:57:53 +0000 (+0100) Subject: rxgen: The string and bytes decode functions must advance the cursor X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f95fc2e73d5149be2b728925452beccad1ea8cda;p=users%2Fdhowells%2Fkafs-utils.git 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 --- 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;