summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index c84319f2..e208775f 100644
--- a/src/util.c
+++ b/src/util.c
@@ -371,6 +371,11 @@ util_get_lines(const char *filename)
char *
util_expand_home(char *buffer, const char *filename, size_t length)
{
+ if (strlen(filename) >= length)
+ {
+ *buffer = 0;
+ return NULL;
+ }
if (*filename == '~')
{
const char *home = g_getenv("HOME");