about summary refs log tree commit diff stats
path: root/xombrero.h
diff options
context:
space:
mode:
authorJosh Rickmar <jrick@devio.us>2012-06-06 14:40:29 -0400
committerJosh Rickmar <jrick@devio.us>2012-06-07 09:11:35 -0400
commit8c87a2283c7cec587d11bcd165dfe0408451aea6 (patch)
treef62dd6ec0c8f98a7e5a65754060bac8a6aca68b9 /xombrero.h
parent3298d9a24118b28173f3b606d7aed8fd8fee44f7 (diff)
downloadxombrero-8c87a2283c7cec587d11bcd165dfe0408451aea6.tar.gz
Set default char * setting pointers to NULL and g_strdup the default
values from static memory, as they will be g_free()'d later if changed
at runtime or from parsing the config.  "Special" settings (struct
special) do not need this as they use their own set functions.

This also fixes a bad bug where default_script pointed to "" somewhere
in static memory instead of an array of PATH_MAX size.  This fixes a
crash when compiled with clang where changing this setting would try
to write a string possibly as large as PATH_MAX and overwrite other
static data.

Finally, make ssl_ca_file static to match all the other strings that
represent files or directories.  Make it a special setting so static
memory is never freed.  As an added bonus, ssl_ca_file is now tilde
expanded.
Diffstat (limited to 'xombrero.h')
-rw-r--r--xombrero.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/xombrero.h b/xombrero.h
index 78812ed..cac8ca8 100644
--- a/xombrero.h
+++ b/xombrero.h
@@ -566,11 +566,11 @@ int		fork_exec(struct tab *, char *, const gchar *, char *, int);
 #define XT_DS_SESSION_TIMEOUT	(3600)
 #define XT_DS_COOKIE_POLICY	SOUP_COOKIE_JAR_ACCEPT_ALWAYS
 #define XT_DS_SSL_STRICT_CERTS	FALSE
+#define XT_DS_SSL_CA_FILE	("")
 #define XT_DS_ENABLE_STRICT_TRANSPORT	TRUE
 #define XT_DS_APPEND_NEXT	(1)
 #define XT_DS_HOME		("https://www.cyphertite.com/")
 #define XT_DS_SEARCH_STRING	("about:search")
-#define XT_DS_HTTP_PROXY	NULL
 #define XT_DS_COLOR_VISITED_URIS	(1)
 #define XT_DS_SESSION_AUTOSAVE	(0)
 #define XT_DS_GUESS_SEARCH	(0)
@@ -673,7 +673,7 @@ int		set_encoding(struct tab *, struct karg *);
 int		set_gui_mode(struct settings *, char *);
 int		set_cookie_policy(struct settings *, char *);
 int		set_search_string(char *);
-int		set_ssl_ca_file(char *);
+int		set_ssl_ca_file(struct settings *, char *);
 char		*get_browser_mode(struct settings *);
 char		*get_gui_mode(struct settings *);
 char		*get_cookie_policy(struct settings *);
@@ -720,7 +720,7 @@ extern int	enable_cookie_whitelist;
 extern int	enable_js_whitelist;
 extern int	session_timeout;
 extern int	cookie_policy;
-extern char	*ssl_ca_file;
+extern char	ssl_ca_file[PATH_MAX];
 extern char	*resource_dir;
 extern gboolean	ssl_strict_certs;
 extern gboolean	enable_strict_transport;