mirror of
https://github.com/yrutschle/sslh.git
synced 2025-06-08 11:22:07 +03:00
defensive programming against inconsistent configuration (fix #336 more)
This commit is contained in:
parent
5168fe081a
commit
8b604a3db7
7
probe.c
7
probe.c
@ -395,6 +395,13 @@ int probe_buffer(char* buf, int len,
|
|||||||
return PROBE_AGAIN;
|
return PROBE_AGAIN;
|
||||||
|
|
||||||
/* Everything failed: match the last one */
|
/* 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];
|
*proto_out = proto_in[proto_len-1];
|
||||||
return PROBE_MATCH;
|
return PROBE_MATCH;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user