emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 48af19c: Fix buffer overflow in ns_compute_glyph_string_overh


From: Michael Albinus
Subject: Re: master 48af19c: Fix buffer overflow in ns_compute_glyph_string_overhangs
Date: Fri, 05 Nov 2021 19:37:04 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

larsi@gnus.org (Lars Ingebrigtsen) writes:

> branch: master
> commit 48af19c1f06c2f3b20e4056bedf137a5e3c0e05e
> Author: Daniel Martín <mardani29@yahoo.es>
> Commit: Lars Ingebrigtsen <larsi@gnus.org>
>
>     Fix buffer overflow in ns_compute_glyph_string_overhangs
>
>     * src/nsterm.m (ns_compute_glyph_string_overhangs): When the first
>     glyph of a glyph string is a composite glyph, `s->nchars' is 0, so
>     "s->char2b + s->nchars - 1" dereferenced a position before buffer
>     `s->char2b'.  Instead, rewrite part of the function to distinguish
>     between character glyphs and composite glyphs.  For character glyphs,
>     calculate the font metrics using the `text_extents' function, passing
>     it the entire glyph string; for composite glyphs, call
>     `composition_gstring_width'. (Bug#51105)
> ---
>  src/nsterm.m | 29 ++++++++++++++++++-----------
>  1 file changed, 18 insertions(+), 11 deletions(-)

This breaks the compilation on emba, see for example
<https://emba.gnu.org/emacs/emacs/-/jobs/31765/raw>.

Best regards, Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]