mirror of
https://github.com/mintycube/dmenu.git
synced 2024-10-22 14:05:48 +02:00
pango: passing -fn option could lead to segfault due to writing out of bounds
This commit is contained in:
parent
4f71e5593e
commit
9ef1b3c317
@ -30,7 +30,7 @@ static int restrict_return = 0; /* -1 option; if 1, disables shift-r
|
|||||||
#endif // RESTRICT_RETURN_PATCH
|
#endif // RESTRICT_RETURN_PATCH
|
||||||
/* -fn option overrides fonts[0]; default X11 font or font set */
|
/* -fn option overrides fonts[0]; default X11 font or font set */
|
||||||
#if PANGO_PATCH
|
#if PANGO_PATCH
|
||||||
static char font[] = "monospace 10";
|
static char *font = "monospace 10";
|
||||||
#else
|
#else
|
||||||
#if XRESOURCES_PATCH
|
#if XRESOURCES_PATCH
|
||||||
static char *fonts[] =
|
static char *fonts[] =
|
||||||
|
2
dmenu.c
2
dmenu.c
@ -2054,7 +2054,7 @@ main(int argc, char *argv[])
|
|||||||
prompt = argv[++i];
|
prompt = argv[++i];
|
||||||
else if (!strcmp(argv[i], "-fn")) /* font or font set */
|
else if (!strcmp(argv[i], "-fn")) /* font or font set */
|
||||||
#if PANGO_PATCH
|
#if PANGO_PATCH
|
||||||
strcpy(font, argv[++i]);
|
font = argv[++i];
|
||||||
#else
|
#else
|
||||||
fonts[0] = argv[++i];
|
fonts[0] = argv[++i];
|
||||||
#endif // PANGO_PATCH
|
#endif // PANGO_PATCH
|
||||||
|
2
drw.c
2
drw.c
@ -234,7 +234,7 @@ xfont_free(Fnt *font)
|
|||||||
|
|
||||||
#if PANGO_PATCH
|
#if PANGO_PATCH
|
||||||
Fnt*
|
Fnt*
|
||||||
drw_font_create(Drw* drw, const char font[])
|
drw_font_create(Drw* drw, const char *font)
|
||||||
{
|
{
|
||||||
Fnt *fnt = NULL;
|
Fnt *fnt = NULL;
|
||||||
|
|
||||||
|
2
drw.h
2
drw.h
@ -55,7 +55,7 @@ void drw_free(Drw *drw);
|
|||||||
|
|
||||||
/* Fnt abstraction */
|
/* Fnt abstraction */
|
||||||
#if PANGO_PATCH
|
#if PANGO_PATCH
|
||||||
Fnt *drw_font_create(Drw* drw, const char font[]);
|
Fnt *drw_font_create(Drw* drw, const char *font);
|
||||||
void drw_font_free(Fnt* set);
|
void drw_font_free(Fnt* set);
|
||||||
unsigned int drw_font_getwidth(Drw *drw, const char *text, Bool markup);
|
unsigned int drw_font_getwidth(Drw *drw, const char *text, Bool markup);
|
||||||
unsigned int drw_fontset_getwidth_clamp(Drw *drw, const char *text, unsigned int n);
|
unsigned int drw_fontset_getwidth_clamp(Drw *drw, const char *text, unsigned int n);
|
||||||
|
Loading…
Reference in New Issue
Block a user