Use a comma instead of a null byte for separating IPs and ports
This was making the client difficult to write as it's not possible to use any of the string functions to copy the full payload across.
This commit is contained in:
parent
19776081b8
commit
2b91931c34
2 changed files with 2 additions and 2 deletions
|
@ -7,7 +7,7 @@ op = sys.argv[1]
|
|||
rest = sys.argv[2:]
|
||||
|
||||
if op == "C":
|
||||
payload = "\0".join(rest)
|
||||
payload = ",".join(rest)
|
||||
else:
|
||||
payload = " ".join(rest)
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ int handle_check_rule(char *data, size_t len) {
|
|||
char* endptr = parse_ip(data, &ip);
|
||||
if (endptr == NULL) {
|
||||
return HANDLER_ILLEGALARG;
|
||||
} else if (endptr[-1] != '\0') {
|
||||
} else if (endptr[-1] != ',') {
|
||||
return HANDLER_ILLEGALARG;
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue