[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Lynx-dev] SOCK5 crash+fix
From: |
Gisle Vanem |
Subject: |
Re: [Lynx-dev] SOCK5 crash+fix |
Date: |
Fri, 11 Mar 2022 13:15:54 +0100 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
Thomas Dickey wrote:
Subject: Re: [Lynx-dev] ..on SOCKS5 support
...
+ p1 = NULL;
+
+ protocol = HTSprintf0(NULL, gettext("(for %s at %s) SOCKS5"),
+ protocol, socks5_host);
+ }
+#ifndef INET6
HTSprintf0 expects to have the address of a pointer in which it
can return a pointer to newly-allocated memory.
'HTSprintf0(NULL,..)' looks okay to me, but crashes
on some condition anyway. Some Runtime-Checks that gets
confused (?).
Anyway, this works better.
int len = snprintf(NULL, 0, gettext("(for %s at %s) SOCKS5"), protocol,
socks5_host);
socks5_protocol = malloc (len+1);
if (!socks5_protocol)
outofmem(__FILE__, "malloc");
snprintf(socks5_buf, len, gettext("(for %s at %s) SOCKS5"), protocol,
socks5_host);
protocol = socks5_protocol;
and I'm happy with that.
--
--gv
- [Lynx-dev] SOCK5 crash+fix, Gisle Vanem, 2022/03/10
- Re: [Lynx-dev] SOCK5 crash+fix, Steffen Nurpmeso, 2022/03/10
- Re: [Lynx-dev] SOCK5 crash+fix, Thorsten Glaser, 2022/03/10
- Re: [Lynx-dev] SOCK5 crash+fix, Thomas Dickey, 2022/03/10
- Re: [Lynx-dev] SOCK5 crash+fix, Steffen Nurpmeso, 2022/03/10
- Re: [Lynx-dev] SOCK5 crash+fix,
Gisle Vanem <=
- Re: [Lynx-dev] SOCK5 crash+fix, Gisle Vanem, 2022/03/11
- Re: [Lynx-dev] SOCK5 crash+fix, Gisle Vanem, 2022/03/11
- Re: [Lynx-dev] SOCK5 crash+fix, Thorsten Glaser, 2022/03/11
- Re: [Lynx-dev] SOCK5 crash+fix, Steffen Nurpmeso, 2022/03/11
- Re: [Lynx-dev] SOCK5 crash+fix, Thomas Dickey, 2022/03/12
- Re: [Lynx-dev] SOCK5 crash+fix, Steffen Nurpmeso, 2022/03/12