diff options
author | ayuseleznev <ayuseleznev@iponweb.net> | 2020-05-18 14:10:28 +0300 |
---|---|---|
committer | ayuseleznev <ayuseleznev@iponweb.net> | 2020-05-18 14:31:49 +0300 |
commit | 8fe35c7614802fa13d144cceea9b079d5a131891 (patch) | |
tree | 802bd3b149d57b3379795d3338a36d385f73cb84 /evdns.c | |
parent | 83ef3216e4a9f1711f260af3889c94cbcbbefacb (diff) | |
download | libevent-8fe35c7614802fa13d144cceea9b079d5a131891.tar.gz |
evdns: Add additional validation for values of dns options
Diffstat (limited to 'evdns.c')
-rw-r--r-- | evdns.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -3531,6 +3531,7 @@ evdns_base_set_option_impl(struct evdns_base *base, base->global_max_retransmits = retries; } else if (str_matches_option(option, "randomize-case:")) { int randcase = strtoint(val); + if (randcase == -1) return -1; if (!(flags & DNS_OPTION_MISC)) return 0; base->global_randomize_case = randcase; } else if (str_matches_option(option, "bind-to:")) { @@ -3554,11 +3555,13 @@ evdns_base_set_option_impl(struct evdns_base *base, sizeof(tv)); } else if (str_matches_option(option, "so-rcvbuf:")) { int buf = strtoint(val); + if (buf == -1) return -1; if (!(flags & DNS_OPTION_MISC)) return 0; log(EVDNS_LOG_DEBUG, "Setting SO_RCVBUF to %s", val); base->so_rcvbuf = buf; } else if (str_matches_option(option, "so-sndbuf:")) { int buf = strtoint(val); + if (buf == -1) return -1; if (!(flags & DNS_OPTION_MISC)) return 0; log(EVDNS_LOG_DEBUG, "Setting SO_SNDBUF to %s", val); base->so_sndbuf = buf; |