summaryrefslogtreecommitdiff
path: root/libmailutils/url
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2020-12-30 09:35:30 +0200
committerSergey Poznyakoff <gray@gnu.org>2020-12-30 09:35:30 +0200
commit139d323eea2e95523aa75f2664330210da5112d3 (patch)
tree33e1aad863fd1ea94c396f02e35550999e2ba444 /libmailutils/url
parent69f10b38b0f7aaef7a6c1aa1ed880e0eb1647204 (diff)
downloadmailutils-139d323eea2e95523aa75f2664330210da5112d3.tar.gz
mailutils-139d323eea2e95523aa75f2664330210da5112d3.tar.bz2
Fix coredump on NULL input to mu_url_create_hint
In particular, this caused inc to coredump when called without explicit -file option. * libmailutils/url/create.c (mu_url_create_hint): Return EINVAL if str is NULL. * mh/tests/inc.at: Add new test.
Diffstat (limited to 'libmailutils/url')
-rw-r--r--libmailutils/url/create.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libmailutils/url/create.c b/libmailutils/url/create.c
index a7e98414e..e9284da59 100644
--- a/libmailutils/url/create.c
+++ b/libmailutils/url/create.c
@@ -562,7 +562,7 @@ mu_url_create_hint (mu_url_t *purl, const char *str, int flags,
struct mu_url_ctx ctx;
mu_url_t url;
- if (!purl)
+ if (!purl || !str)
return EINVAL;
url = calloc (1, sizeof (*url));
if (url == NULL)

Return to:

Send suggestions and report system problems to the System administrator.