From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10975 Path: news.gmane.org!.POSTED!not-for-mail From: He X Newsgroups: gmane.linux.lib.musl.general Subject: Re: a bug in bindtextdomain() and strip '.UTF-8' Date: Sun, 29 Jan 2017 12:52:56 +0800 Message-ID: References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f403045e3b6e24c7520547347a48 X-Trace: blaine.gmane.org 1485665622 26857 195.159.176.226 (29 Jan 2017 04:53:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 29 Jan 2017 04:53:42 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-10990-gllmg-musl=m.gmane.org@lists.openwall.com Sun Jan 29 05:53:38 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1cXhUW-0005gi-AH for gllmg-musl@m.gmane.org; Sun, 29 Jan 2017 05:53:28 +0100 Original-Received: (qmail 5814 invoked by uid 550); 29 Jan 2017 04:53:31 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 5749 invoked from network); 29 Jan 2017 04:53:28 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=NbRyzNl6A8Gfis152RejDpW2GKfdluhXNK0gEhGX4Fw=; b=YfWgof873wSriJ4QWUkntgKtWJhtxp6UxoUgqZW2O+xsE8Jeh4qCLsCVEBabQP/pXb zn7ps3HR4lhqZbLKf9uj2NgUiOCuU6JhRl7eN11iVqaZu/fBvw9JQf+LTVS7mtK+qgNm 9jXYEI1Ij0P9XP2NYET8Tynyz2YDAfRBlss+WMN1+dxukBsfYqRRyHigV6+stkaPWcVp a+CDrse/uoI1JMZsbcRvUX5LFubxqoWYEKWh7Ggb/FFQrJuxmfXphYlj/QZJATey6eSJ MA6oSs1NThuDZnpITSdcKoUqYpvUSGdd+LNrNie15Iwmna7XE1ZaJxvwlY9jrtgDKdpf L57Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=NbRyzNl6A8Gfis152RejDpW2GKfdluhXNK0gEhGX4Fw=; b=sXJH3ubYlBvrGUMfyvNzfoZ8tQA1/u7p7hpzmpM3k06stWE02veQE4Bu0UeGrvuHUL DBi9is+9qe/bDzog9qx2gbe2ak/1I16rE/xpJV6wBUBf6M6/3hzhCV93mWDaU6ElHB1s ywEoJI0+lgBy7nx6ieTWWzDdImm4vKXh4eNSFagwhke5U1HRPacOLoK3ul+0w9H8C9Tp U3PqkPKv77V+EB74shpFu8usVhhKC+/Kxe2x3QgQZS0asOH7CqchEfc9/bxiXQ5fw7ok SoRjJYH7TtDbz9Nm5o9oZUNoD1r33P7Ls4SqEwNZ7pgG0CkEvVb+8+Z/myFDAXguMyDh VB3g== X-Gm-Message-State: AIkVDXJV0jev51wL5AvMzfmRCo3oyc4MilLEMKzJW0Qx/YweaPv9xC6m0Xo/ndF4YvZ/dP+rBauSsEA7uBzPwQ== X-Received: by 10.176.17.18 with SMTP id e18mr6605475uab.112.1485665596653; Sat, 28 Jan 2017 20:53:16 -0800 (PST) In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:10975 Archived-At: --f403045e3b6e24c7520547347a48 Content-Type: text/plain; charset=UTF-8 found two more bugs related to intl: 1. no memset after malloc, caused chromium crash: http://www.openwall.com/lists/musl/2017/01/28/1 --- musl-1.1.16/src/locale/dcngettext.c 2017-01-29 04:42:49.002221317 +0000 +++ musl-1.1.16/src/locale/dcngettext.c 2017-01-29 04:42:49.002221317 +0000 @@ -180,6 +180,7 @@ __munmap((void *)map, map_size); goto notrans; } + memset(p, 0, sizeof *p + namelen + 1); p->map = map; p->map_size = map_size; memcpy(p->name, name, namelen+1); 2. musl uses generic config of libstdc++, which blocked the support of locale, patch is there: https://github.com/xhebox/noname-linux/issues/2#issuecomment-275704150 2017-01-20 19:25 GMT+08:00 He X : > sorry for my poor english :D > > first, it's not p->domainname but q->domainname in dcngettext:77. > > second, any news about http://www.openwall.com/lists/musl/2016/05/11/81? > strip '.UTF-8' is important, i think. > > irc log: > 18:58 < xhe> @dalias: i must found a bug in bindtextdomain(), and also the > improvement about stripping '.UTF-8' should be merged(my code sucks, > that's for my tests), detailed: http://pastebin.com/3C2APqMH > --f403045e3b6e24c7520547347a48 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
found two more bugs related to intl:

1.= no memset after malloc, caused chromium crash:=C2=A0http://www.openwall.com/lists/musl/20= 17/01/28/1
--- musl-1.1.16/src/locale/dcngettext.c 2017-01-29 0= 4:42:49.002221317 +0000
+++ musl-1.1.16/src/locale/dcngettext.c 2017-0= 1-29 04:42:49.002221317 +0000
@@ -180,6 +180,7 @@
=C2= =A0 __munmap((void *)map, map_size);
=C2=A0 goto notrans;
=C2= =A0 = }
+ memset(p, 0, sizeof *p + namelen + 1);
=C2=A0 p->map =3D= map;
=C2=A0 p->map_size =3D map_size;
=C2=A0 memcpy(p->n= ame, name, namelen+1);

2. musl uses generic = config of libstdc++, which blocked the support of locale, patch is there:= =C2=A0https://github.com/xhebox/noname-linux/issues/2#issuecomment-= 275704150

--f403045e3b6e24c7520547347a48--