From owner-freebsd-xfce@freebsd.org Thu Dec 14 09:04:26 2017 Return-Path: Delivered-To: freebsd-xfce@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4925E9D247 for ; Thu, 14 Dec 2017 09:04:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 8C5997B890 for ; Thu, 14 Dec 2017 09:04:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 88D8AE9D246; Thu, 14 Dec 2017 09:04:26 +0000 (UTC) Delivered-To: xfce@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 887F0E9D245 for ; Thu, 14 Dec 2017 09:04:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7709C7B88F for ; Thu, 14 Dec 2017 09:04:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id vBE94QZB097800 for ; Thu, 14 Dec 2017 09:04:26 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: xfce@FreeBSD.org Subject: [Bug 212176] x11/xfce4-taskmanager segfault Date: Thu, 14 Dec 2017 09:04:26 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: madpilot@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: xfce@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback+ X-Bugzilla-Changed-Fields: flagtypes.name cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-xfce@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: XFCE for FreeBSD -- porting and maintaining List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Dec 2017 09:04:26 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D212176 Guido Falsi changed: What |Removed |Added ---------------------------------------------------------------------------- Flags|maintainer-feedback?(xfce@F |maintainer-feedback+ |reeBSD.org) | CC| |madpilot@FreeBSD.org --- Comment #9 from Guido Falsi --- (In reply to Ivan from comment #6) > Created attachment 174716 [details] > patch >=20 > Problem is here > g_strlcpy (text, p, g_utf8_strlen (text, -1)); >=20 > To utf-8 unaware function number of chars are passed instead of bytes, so > it's possible for 2 bytes chars it will split in half leading to incorrect > unicode sequence. >=20 > Attached patch resolves the issue, however crash still can occur if p >=3D > text, however as p is substring of text, the situation is expected to nev= er > happen in normal conditions. >=20 > I found no safe analog in gtk functions for strlcpy, only strncpy which is > not considered safe. The alternative is switch to icu, however this is > another story. Hi, The fix looks simple enough, but I'm not sure that using non utf aware functions is better that using g_utf8_strncpy(), which would warrant utf8 conforming results. also, looking at the g_utf8_strncpy() sources here: https://github.com/GNOME/glib/blob/9c8c6094fdb3b7bff35c0f36a68e1da3fd2e8ff7= /glib/gutf8.c#L413 it would be quite easy to cook up a g_utf8_strlcpy() (or any other name) us= ing the safer system provided strlcpy() call. I'd like your opinion before proceeding though. Any patch we prepare should be created accounting for upstreaming it if possible. --=20 You are receiving this mail because: You are the assignee for the bug.=