--- a/pgp/seahorse-gpg-options.c
+++ b/pgp/seahorse-gpg-options.c
@@ -43,7 +43,7 @@
 #define  GPG_VERSION_PREFIX1   "1."
 #define  GPG_VERSION_PREFIX2   "2."
 
-static gchar gpg_homedir[MAXPATHLEN];
+static gchar *gpg_homedir;
 static gboolean gpg_options_inited = FALSE;
 
 static gboolean
@@ -77,6 +77,9 @@
     g_assert (gpg_options_inited);
     g_assert (!err || !*err);
 
+    if (!gpg_homedir)
+        return NULL;
+
     /* Check for and open ~/.gnupg/gpg.conf */
     conf = g_strconcat (gpg_homedir, "/gpg.conf", NULL);
     if (g_file_test (conf, G_FILE_TEST_IS_REGULAR | G_FILE_TEST_EXISTS)) 
@@ -208,16 +211,14 @@
                     *x = 0;
                     g_strstrip (t);
 
-                    gpg_homedir[0] = 0;
+                    g_free (gpg_homedir);
 
                     /* If it's not a rooted path then expand */
                     if (t[0] == '~') {
-                        g_strlcpy (gpg_homedir, g_get_home_dir (),
-                                   sizeof (gpg_homedir));
-                        t++;
+                        gpg_homedir = g_strconcat (g_get_home_dir(), ++t);
+                    } else {
+                        gpg_homedir = g_strdup (t);
                     }
-
-                    g_strlcat (gpg_homedir, t, sizeof (gpg_homedir));
                     found = TRUE;
                 }
             }
