summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-04-06 19:55:47 +0200
committerDave Davenport <qball@gmpclient.org>2017-04-06 19:55:47 +0200
commitb227fece109606096065185ec14b029ffe5c153b (patch)
treea4bc546c64889f17c01d8d62b6576db72e88fefa /source
parent898b5466f0ba83dbe098ca40bf0d3bdda47f5033 (diff)
Fix some warning that converity scan picked up.
Diffstat (limited to 'source')
-rw-r--r--source/helper.c4
-rw-r--r--source/theme.c6
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;
}
}