diff options
author | Jan Hutter <jhutter@hsr.ch> | 2005-11-23 07:17:31 +0000 |
---|---|---|
committer | Jan Hutter <jhutter@hsr.ch> | 2005-11-23 07:17:31 +0000 |
commit | 29b8cafcfdd70f0f72bc6dd8b800d5c805871fdb (patch) | |
tree | df272da633bb9f3ee5f44e6594818eeff664b637 /Source/charon/transforms | |
parent | 99a9676d456c043c4b8dd856ef28d5e413b402d7 (diff) | |
download | strongswan-29b8cafcfdd70f0f72bc6dd8b800d5c805871fdb.tar.bz2 strongswan-29b8cafcfdd70f0f72bc6dd8b800d5c805871fdb.tar.xz |
- buffer pointer was not increased
Diffstat (limited to 'Source/charon/transforms')
-rw-r--r-- | Source/charon/transforms/prf_plus.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/charon/transforms/prf_plus.c b/Source/charon/transforms/prf_plus.c index 5b3e7df2f..54d18156d 100644 --- a/Source/charon/transforms/prf_plus.c +++ b/Source/charon/transforms/prf_plus.c @@ -72,6 +72,7 @@ static status_t get_bytes(private_prf_plus_t *this, size_t length, u_int8_t *buf { chunk_t appending_chunk; size_t bytes_in_round; + size_t total_bytes_written = 0; appending_chunk.ptr = &(this->appending_octet); appending_chunk.len = 1; @@ -89,10 +90,11 @@ static status_t get_bytes(private_prf_plus_t *this, size_t length, u_int8_t *buf /* how many bytes can we write in this round ? */ bytes_in_round = min(length, this->buffer.len - this->given_out); /* copy bytes from buffer with offset */ - memcpy(buffer, this->buffer.ptr + this->given_out, bytes_in_round); + memcpy(buffer + total_bytes_written, this->buffer.ptr + this->given_out, bytes_in_round); length -= bytes_in_round; this->given_out += bytes_in_round; + total_bytes_written += bytes_in_round; } return SUCCESS; } |