vp-build/srcpkgs/libevent/patches/CVE-2016-10197.patch

22 lines
788 B
Diff

From ec65c42052d95d2c23d1d837136d1cf1d9ecef9e Mon Sep 17 00:00:00 2001
From: Azat Khuzhin <a3at.mail@gmail.com>
Date: Fri, 25 Mar 2016 00:33:47 +0300
Subject: [PATCH] evdns: fix searching empty hostnames
--- evdns.c
+++ evdns.c
@@ -3175,9 +3175,12 @@ search_set_from_hostname(struct evdns_base *base) {
static char *
search_make_new(const struct search_state *const state, int n, const char *const base_name) {
const size_t base_len = strlen(base_name);
- const char need_to_append_dot = base_name[base_len - 1] == '.' ? 0 : 1;
+ char need_to_append_dot;
struct search_domain *dom;
+ if (!base_len) return NULL;
+ need_to_append_dot = base_name[base_len - 1] == '.' ? 0 : 1;
+
for (dom = state->head; dom; dom = dom->next) {
if (!n--) {
/* this is the postfix we want */