aboutsummaryrefslogtreecommitdiffstats
path: root/Source/charon/tests/socket_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'Source/charon/tests/socket_test.c')
-rw-r--r--Source/charon/tests/socket_test.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/charon/tests/socket_test.c b/Source/charon/tests/socket_test.c
index 98a1eb16d..4e761496b 100644
--- a/Source/charon/tests/socket_test.c
+++ b/Source/charon/tests/socket_test.c
@@ -38,7 +38,9 @@ void test_socket(tester_t *tester)
packet_t *pkt = packet_create(AF_INET);
char *test_string = "Testing functionality of socket_t";
- pkt->data.ptr = test_string;
+
+ pkt->data.ptr = alloc_bytes(strlen(test_string),"test_string");
+ memcpy(pkt->data.ptr,test_string,strlen(test_string));
pkt->data.len = strlen(test_string);
/* send to previously bound socket */