summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-07-09 17:43:21 +0100
committerVincent Sanders <vince@kyllikki.org>2015-07-09 17:44:51 +0100
commit5b09363597d9586ec421817459efe8a242c953c8 (patch)
treecf1ecd1d319ce5d9bdf946165f6b2bb5d293933a
parentcd1949bc964d2b1846f9745d914213548217d2e1 (diff)
downloadnetsurf-5b09363597d9586ec421817459efe8a242c953c8.tar.gz
netsurf-5b09363597d9586ec421817459efe8a242c953c8.tar.bz2
Add asserts to ensure operations not passed bad pointers
-rw-r--r--utils/nsurl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/utils/nsurl.c b/utils/nsurl.c
index 9e19275cc..8431916be 100644
--- a/utils/nsurl.c
+++ b/utils/nsurl.c
@@ -1554,6 +1554,8 @@ nserror nsurl_get(const nsurl *url, nsurl_component parts,
struct nsurl_component_lengths str_len = { 0, 0, 0, 0, 0, 0, 0, 0 };
enum nsurl_string_flags str_flags = 0;
+ assert(url != NULL);
+
/* Get the string length and find which parts of url need copied */
nsurl__get_string_data(&(url->components), parts, url_l,
&str_len, &str_flags);
@@ -1704,6 +1706,8 @@ const char *nsurl_access_leaf(const nsurl *url)
const char *path;
const char *leaf;
+ assert(url != NULL);
+
if (url->components.path == NULL)
return "";