aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2011-04-14 19:41:57 +0200
committerMartin Willi <martin@revosec.ch>2011-04-14 20:02:11 +0200
commiteea2bdb203f5ef0da5764b1b83dfbbeabf984b26 (patch)
treebb29f482386e817a948f8bd15ec5773fd9669a55 /src
parent823d2f503575ba08ff405ae5e624146fb512859a (diff)
downloadstrongswan-eea2bdb203f5ef0da5764b1b83dfbbeabf984b26.tar.bz2
strongswan-eea2bdb203f5ef0da5764b1b83dfbbeabf984b26.tar.xz
Fix tls_writer wrap functions
Diffstat (limited to 'src')
-rw-r--r--src/libtls/tls_writer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libtls/tls_writer.c b/src/libtls/tls_writer.c
index e87c2efea..57c60fdaf 100644
--- a/src/libtls/tls_writer.c
+++ b/src/libtls/tls_writer.c
@@ -143,7 +143,7 @@ METHOD(tls_writer_t, wrap8, void,
{
increase(this);
}
- memmove(this->buf.ptr + 1, this->buf.ptr, 1);
+ memmove(this->buf.ptr + 1, this->buf.ptr, this->used);
this->buf.ptr[0] = this->used;
this->used += 1;
}
@@ -155,7 +155,7 @@ METHOD(tls_writer_t, wrap16, void,
{
increase(this);
}
- memmove(this->buf.ptr + 2, this->buf.ptr, 2);
+ memmove(this->buf.ptr + 2, this->buf.ptr, this->used);
htoun16(this->buf.ptr, this->used);
this->used += 2;
}
@@ -169,7 +169,7 @@ METHOD(tls_writer_t, wrap24, void,
{
increase(this);
}
- memmove(this->buf.ptr + 3, this->buf.ptr, 3);
+ memmove(this->buf.ptr + 3, this->buf.ptr, this->used);
len = htonl(this->used);
memcpy(this->buf.ptr, ((char*)&len) + 1, 3);
@@ -183,7 +183,7 @@ METHOD(tls_writer_t, wrap32, void,
{
increase(this);
}
- memmove(this->buf.ptr + 4, this->buf.ptr, 4);
+ memmove(this->buf.ptr + 4, this->buf.ptr, this->used);
htoun32(this->buf.ptr, this->used);
this->used += 4;
}