mirror of
https://code.semirocket.science/wrapsix
synced 2024-12-22 04:20:18 +02:00
Fixed another SIGSEGV
This commit is contained in:
parent
a7f750a3e0
commit
707eb6159b
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user