Skip to content

Commit

Permalink
Fix buffer overflow in xdrawglyph() (#119)
Browse files Browse the repository at this point in the history
The buffer overflow occurs when the ligatures patch is enabled and
xmakeglyphfontspecs() returns more than one XftGlyphFontSpec.

Ref. cog1to/st-ligatures#35
  • Loading branch information
veltza authored Mar 11, 2024
1 parent a28f3e0 commit 9a41526
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions x.c
Original file line number Diff line number Diff line change
Expand Up @@ -2553,10 +2553,10 @@ void
xdrawglyph(Glyph g, int x, int y)
{
int numspecs;
XftGlyphFontSpec spec;
XftGlyphFontSpec *specs = xw.specbuf;

numspecs = xmakeglyphfontspecs(&spec, &g, 1, x, y);
xdrawglyphfontspecs(&spec, g, numspecs, x, y
numspecs = xmakeglyphfontspecs(specs, &g, 1, x, y);
xdrawglyphfontspecs(specs, g, numspecs, x, y
#if WIDE_GLYPHS_PATCH
,DRAW_BG | DRAW_FG
#endif // WIDE_GLYPHS_PATCH
Expand Down

0 comments on commit 9a41526

Please sign in to comment.