From 707eb6159b5f4fe1db29735b193a353f4156f6ca Mon Sep 17 00:00:00 2001 From: Michal Zima Date: Sun, 13 May 2012 21:59:21 +0200 Subject: [PATCH] Fixed another SIGSEGV --- src/udp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/udp.c b/src/udp.c index bbaff41..119e777 100644 --- a/src/udp.c +++ b/src/udp.c @@ -184,7 +184,7 @@ int udp_ipv6(struct s_ethernet *eth6, struct s_ipv6 *ip6, char *payload) } /* allocate memory for translated packet */ - packet_size = sizeof(struct s_ipv4) + ip6->len; + packet_size = sizeof(struct s_ipv4) + htons(ip6->len); if ((packet = (unsigned char *) malloc(packet_size)) == NULL) { fprintf(stderr, "[Error] Lack of free memory\n"); return 1;