Date: 2013-10-02 21:02:41 +0200 myaddrs(): assign result to return value.. Karol Błażewicz reported a problem he had with an Arch Linux S-nail test package [1]. [1] (gdb) run -s test karol Starting program: /home/karol/apps/s-nail/src/s-nail-14.4.2/./s-nail -s test karol warning: Could not load shared library symbols for linux-gate.so.1. Do you need "set solib-search-path" or "set sysroot"? test ^DEOT Program received signal SIGSEGV, Segmentation fault. 0xb7c3e016 in __strlen_sse2_bsf () from /usr/lib/libc.so.6 (gdb) bt #0 0xb7c3e016 in __strlen_sse2_bsf () from /usr/lib/libc.so.6 #1 0x0808978c in smtp_auth_var (atype=atype@entry=0x809c5b7 "-user", addr=addr@entry=0x0) at smtp.c:316 #2 0x08086293 in start_mta (to=to@entry=0x80a84d0 <_builtin_buf+16>, input=input@entry=0x80ca678, hp=hp@entry=0xbffff500) at sendout.c:894 #3 0x08086936 in transfer (to=to@entry=0x80a84d0 <_builtin_buf+16>, input=input@entry=0x80ca678, hp=hp@entry=0xbffff500) at sendout.c:848 #4 0x08088d2f in mail1 (hp=hp@entry=0xbffff500, printheaders=printheaders@entry=0, quote=quote@entry=0x0, quotefile=quotefile@entry=0x0, recipient_record=recipient_record@entry=0, doprefix=doprefix@entry=0) at sendout.c:1186 #5 0x08088e82 in mail (to=0x80a84d0 <_builtin_buf+16>, cc=0x0, bcc=0x0, subject=0xbffff898 "test", attach=0x0, quotefile=quotefile@entry=0x0, recipient_record=0) at sendout.c:766 #6 0x0804c429 in main (argc=4, argv=0xbffff684) at main.c:712 This bug i've introduced in [9385b90e] (Move myaddrs(),myorigin() from smtp.c to head.c.., 2012-12-18). Unfortunately it seems i was in a hurry and nonetheless not only moved the functions but also slightly rewrote them. (Pain.) --- head.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/head.c b/head.c index 95fab58..3dd77e9 100644 --- a/head.c +++ b/head.c @@ -385,7 +385,7 @@ myaddrs(struct header *hp) */ if (value("smtp") == NULL) goto jleave; - if (addr == NULL) { + if ((ret = addr) == NULL) { char *hn = nodename(1); size_t sz = strlen(myname) + strlen(hn) + 2; ret = addr = smalloc(sz);