diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/helper.c | 4 | ||||
-rw-r--r-- | source/theme.c | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/source/helper.c b/source/helper.c index ff1d002c..f4b010fc 100644 --- a/source/helper.c +++ b/source/helper.c @@ -678,6 +678,10 @@ char *rofi_expand_path ( const char *input ) unsigned int levenshtein ( const char *needle, const glong needlelen, const char *haystack, const glong haystacklen ) { + if ( needlelen == G_MAXLONG ){ + // String to long, we cannot handle this. + return UINT_MAX; + } unsigned int column[needlelen + 1]; for ( glong y = 0; y <= needlelen; y++ ) { column[y] = y; diff --git a/source/theme.c b/source/theme.c index 120221d3..67fb1943 100644 --- a/source/theme.c +++ b/source/theme.c @@ -238,7 +238,9 @@ static void rofi_theme_print_index ( ThemeWidget *widget ) } void rofi_theme_print ( ThemeWidget *widget ) { - rofi_theme_print_index ( widget ); + if ( widget != NULL ) { + rofi_theme_print_index ( widget ); + } } /** @@ -382,7 +384,7 @@ Property *rofi_theme_find_property ( ThemeWidget *widget, PropertyType type, con // Resolve link. rofi_theme_resolve_link_property ( p, 0 ); } - if ( p->value.link.ref->type == type ) { + if ( p->value.link.ref != NULL && p->value.link.ref->type == type ) { return p->value.link.ref; } } |