According to evdns.c, the result not freed by libevent after
the callback runs:
evdns_getaddrinfo_gotresolve()
{
...
data->user_cb(0, data->pending_result, data->user_data);
data->pending_result = NULL;
...
}
To reproduce, build with -fsanitize=address, add -g to the getopt
list in dns-example.c like in the current commit and run
dns-example -g google.com
Closes: #681 # cherry-picked
LibreSSL 2.7 implements OpenSSL 1.1 API except for BIO_get_init()
See also: https://bugs.freebsd.org/226900
Signed-off-by: Bernard Spil <brnrd@FreeBSD.org>
Closes: #617 (cherry-pick)
This reverts commit c4e9d9bd662de7f575f2172c160795d452ebe709
("sample/https-client: check for ERR_remove_thread_state() existence").
Calling AC_SEARCH_LIBS() modifies LIBS - -lcrypto incorrectly
ends up in LIBS, and thus linked to by libevent_core.so.
Checking for ERR_remove_thread_state should no longer be needed
because it was introduced in openssl 1.0.0, and the previous line
0.9.8 had support discontinued at the end of 2015.
Fixes: #473
Currently a static (Debian) certificate path is used by default, which
can be overridden using the -crt parameter. This commit changes the
default behaviour such that the openssl default certificate store is
used, unless overridden by -crt.
Signed-off-by: David Disseldorp <ddiss@suse.de>
==> netbsd: In file included from ../listener.c:57:0:
==> netbsd: ../util-internal.h:58:0: warning: "__func__" redefined [enabled by default]
==> netbsd: #define __func__ EVENT____func__
==> netbsd: ^
==> netbsd: In file included from /usr/include/amd64/types.h:39:0,
==> netbsd: from /usr/include/sys/types.h:45,
==> netbsd: from ../listener.c:30:
==> netbsd: /usr/include/sys/cdefs.h:394:0: note: this is the location of the previous definition
==> netbsd: #define __func__ __PRETTY_FUNCTION__
Like in `sockaddr_in` structure in /usr/include/netinet/in.h
@azat: convert all other users (bench, compat, ..) and tweak message
Fixes: #178Fixes: #196
Refs: 6bf1ca78
Link: https://codereview.appspot.com/156040043/#msg4
Now it included by openssl, but nfter
openssl/openssl@master-post-reformat-1494-g6329b60 it will print warning
(apparently they dropped <string.h> from the generic headers).
We can't do this using resolv.conf:
$ dns-example -v -c <(echo nameserver 127.0.0.1:10053) ya.ru
Because of how evutil_read_file_() works (using fstat())
And actually glibc for example will not use port from nameserver line, and
because of inet_aton() it will fail if nameserver will have arbitary port:
(gdb) p inet_aton("127.0.0.1", malloc(10000))
$1 = 1
(gdb) p inet_aton("127.0.0.1:53", malloc(10000))
$2 = 0
From glibc/resolv/res_init.c:
if (MATCH(buf, "nameserver") && nserv < MAXNS) {
struct in_addr a;
cp = buf + sizeof("nameserver") - 1;
while (*cp == ' ' || *cp == '\t')
cp++;
if ((*cp != '\0') && (*cp != '\n')
&& __inet_aton(cp, &a)) {
statp->nsaddr_list[nservall].sin_addr = a;
statp->nsaddr_list[nservall].sin_family = AF_INET;
statp->nsaddr_list[nservall].sin_port =
htons(NAMESERVER_PORT);