mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-17 01:33:16 +03:00
Add asserts to ensure operations not passed bad pointers
This commit is contained in:
parent
cd1949bc96
commit
5b09363597
@ -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 "";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user