mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
draw: fix NULL pointer passed to pango_parse_markup()
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
bb6c309dfe
commit
9c8efee9bf
1 changed files with 4 additions and 0 deletions
4
draw.c
4
draw.c
|
@ -79,6 +79,7 @@ draw_iso2utf8(const char *iso, size_t len, char **dest, ssize_t *dlen)
|
|||
{
|
||||
warn("text conversion failed: %s", strerror(errno));
|
||||
p_delete(dest);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(dlen)
|
||||
|
@ -172,6 +173,9 @@ draw_text_context_init(draw_text_context_t *data, const char *str, ssize_t slen)
|
|||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if(!str)
|
||||
return false;
|
||||
|
||||
if(!pango_parse_markup(str, slen, 0, &data->attr_list, &data->text, NULL, &error))
|
||||
{
|
||||
warn("cannot parse pango markup: %s", error ? error->message : "unknown error");
|
||||
|
|
Loading…
Reference in a new issue