]> www.infradead.org Git - users/dhowells/kafs-utils.git/commitdiff
rxgen: The string and bytes decode functions must advance the cursor
authorDavid Howells <dhowells@redhat.com>
Fri, 11 Apr 2014 22:57:53 +0000 (23:57 +0100)
committerDavid Howells <dhowells@redhat.com>
Fri, 11 Apr 2014 22:57:53 +0000 (23:57 +0100)
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 <dhowells@redhat.com>
af_rxrpc.c
py_rxgen.c

index 996699453a62d9f1e6525d27898fb82ba1251f36..4dce64bb569f562e279a5e8e5fd1e9d70cdf9ef4 100644 (file)
@@ -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;
        }
index acdfa9b7a024d3c753186c8e4b41b076049f2bd1..6a261d290f39ba325c398ee7fadf2af93365f916 100644 (file)
@@ -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;