Skip to content

Commit

Permalink
Merge pull request #663 from adfnekc/master
Browse files Browse the repository at this point in the history
fix udp payload data messy probelem;fix payloads_datagram_add bug;
  • Loading branch information
robertdavidgraham authored Nov 1, 2023
2 parents 5ad190d + aabbb26 commit 7397d80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/templ-payloads.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ payloads_datagram_add(struct PayloadsUDP *payloads,
payloads->list[j] = p;

payloads->count += count;
count = 1;
}
}
return count; /* zero or one */
Expand Down
4 changes: 2 additions & 2 deletions src/templ-pkt.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,9 @@ struct TemplateSet templ_copy(const struct TemplateSet *templset)
for (i=0; i<templset->count; i++) {
const struct TemplatePacket *p1 = &templset->pkts[i];
struct TemplatePacket *p2 = &result.pkts[i];
p2->ipv4.packet = MALLOC(p2->ipv4.length);
p2->ipv4.packet = MALLOC(2048+p2->ipv4.length);
memcpy(p2->ipv4.packet, p1->ipv4.packet, p2->ipv4.length);
p2->ipv6.packet = MALLOC(p2->ipv6.length);
p2->ipv6.packet = MALLOC(2048+p2->ipv6.length);
memcpy(p2->ipv6.packet, p1->ipv6.packet, p2->ipv6.length);
}

Expand Down

0 comments on commit 7397d80

Please sign in to comment.