+Cc maintainer

On Mon, Oct 18, 2021 at 09:07:07PM +0000, James Cook wrote:
> I don't know if this is related to the other recent neomutt segfault
> thread.

Unlikely.

> falsifian moth ~ $ pkg_info neomutt
> Information for inst:neomutt-20211015

So it seems you're running -current, right?

> Thread 1 received signal SIGSEGV, Segmentation fault.
> _libc_freeaddrinfo (ai=0x0) at /usr/src/lib/libc/net/freeaddrinfo.c:46
> 46                      free(p->ai_canonname);
> (gdb) bt
> #0  _libc_freeaddrinfo (ai=0x0) at /usr/src/lib/libc/net/freeaddrinfo.c:46
> #1  0x0000079ac809e2b6 in getdnsdomainname ()

freeaddrinfo(3) is not NULL safe.

> falsifian moth ~ $ dmesg|head -n1
> OpenBSD 7.0 (GENERIC.MP) #232: Thu Sep 30 14:25:29 MDT 2021
> 
> falsifian moth ~ $ uname -a
> OpenBSD moth.falsifian.org 7.0 GENERIC.MP#43 amd64

These two kernel lines don't match and don't immediately tell me if
you're on release or -current. 'sysctl kern.version' is better.

The diff below should fix your problem. Could you check, please?

Index: Makefile
===================================================================
RCS file: /cvs/ports/mail/neomutt/Makefile,v
retrieving revision 1.67
diff -u -p -r1.67 Makefile
--- Makefile    15 Oct 2021 11:09:00 -0000      1.67
+++ Makefile    18 Oct 2021 21:15:46 -0000
@@ -5,6 +5,7 @@ COMMENT=        tty-based e-mail client, Mutt w
 GH_ACCOUNT=    neomutt
 GH_PROJECT=    neomutt
 GH_TAGNAME=    20211015
+REVISION=      0
 
 CATEGORIES=    mail
 HOMEPAGE=      https://neomutt.org/
Index: patches/patch-conn_getdomain_c
===================================================================
RCS file: patches/patch-conn_getdomain_c
diff -N patches/patch-conn_getdomain_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-conn_getdomain_c      18 Oct 2021 21:15:34 -0000
@@ -0,0 +1,15 @@
+$OpenBSD$
+
+Index: conn/getdomain.c
+--- conn/getdomain.c.orig
++++ conn/getdomain.c
+@@ -149,7 +149,8 @@ int getdnsdomainname(struct Buffer *result)
+     rc = 0;
+     mutt_debug(LL_DEBUG1, "Hostname: %s\n", mutt_buffer_string(result));
+   }
+-  freeaddrinfo(lookup_result);
++  if (lookup_result)
++    freeaddrinfo(lookup_result);
+ #endif
+ 
+   return rc;

Reply via email to