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.
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;