defensive programming against inconsistent configuration (fix #336 more)

This commit is contained in:
Yves Rűtschlé 2022-07-24 17:50:13 +02:00
parent 5168fe081a
commit 8b604a3db7

View File

@ -395,6 +395,13 @@ int probe_buffer(char* buf, int len,
return PROBE_AGAIN;
/* Everything failed: match the last one */
if (proto_len == 0) {
/* This should be caught by configuration sanity checks, but just in
* case, die gracefully rather than segfaulting */
print_message(msg_int_error, "Received traffic on transport that has no target\n");
exit(0);
}
*proto_out = proto_in[proto_len-1];
return PROBE_MATCH;
}