BUG/MINOR: server: risk of over reading the pref_net array.
dns_option struct pref_net field is an array of 5. The issue
here shows that pref_net_nb can go up to 5 as well which might lead
to read outside of this array.
diff --git a/src/server.c b/src/server.c
index 72799bb..5a2c58a 100644
--- a/src/server.c
+++ b/src/server.c
@@ -1116,7 +1116,7 @@
e = p;
while (*p != '\0') {
/* If no room avalaible, return error. */
- if (opt->pref_net_nb > SRV_MAX_PREF_NET) {
+ if (opt->pref_net_nb >= SRV_MAX_PREF_NET) {
Alert("parsing [%s:%d]: '%s' exceed %d networks.\n",
file, linenum, args[cur_arg], SRV_MAX_PREF_NET);
err_code |= ERR_ALERT | ERR_FATAL;