Skip to content

Commit

Permalink
Fix handling of hex UDP args. (zmap#675)
Browse files Browse the repository at this point in the history
In the current code it is not possible to pass `--probe-args=hex:..`
to the `udp` probe module. The following error message is displayed:
```
udp: unknown UDP probe specification (expected file:/path or text:STRING or hex:01020304 or template:/path or template-fields)
```
  • Loading branch information
svbatalov authored Aug 16, 2021
1 parent 615d2ee commit e625873
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/probe_modules/module_udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ int udp_global_initialize(struct state_conf *conf)

udp_template = udp_template_load(in, in_len, &udp_template_max_len);
module_udp.make_packet = udp_make_templated_packet;
} else if (strcmp(args, "hex") == 0) {
} else if (strncmp(args, "hex", arg_name_len) == 0) {
udp_fixed_payload_len = strlen(c) / 2;
udp_fixed_payload = xmalloc(udp_fixed_payload_len);

Expand Down

0 comments on commit e625873

Please sign in to comment.