summaryrefslogtreecommitdiff
path: root/libmailutils/url
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2015-09-19 13:23:50 +0300
committerSergey Poznyakoff <gray@gnu.org>2015-09-19 13:37:09 +0300
commitad3cc340266af4e1d768e6d3e59594f78cd6f940 (patch)
treec1b111a06c0b9bbe5ce806ed02089f5f1523d307 /libmailutils/url
parentf160ca75991d5bf994afe3cb5bc549b113b14bbd (diff)
downloadmailutils-ad3cc340266af4e1d768e6d3e59594f78cd6f940.tar.gz
mailutils-ad3cc340266af4e1d768e6d3e59594f78cd6f940.tar.bz2
Complement f160ca75
* include/mailutils/wordsplit.h (MU_WRDSX_WORD) (MU_WRDSX_QUOTE): New constants. (mu_wordsplit_getwords): Rename to mu_wordsplit_get_words. * libmailutils/string/wordsplit.c (mu_wordsplit_getwords): Rename to mu_wordsplit_get_words. * libmailutils/base/userprivs.c (mu_switch_to_privs): Fix memory overrun when retrieving the current pointer. * examples/header.c (main): Use mu_wordsplit_get_words * imap4d/preauth.c (preauth_getvar): Rewrite according to the new API. * libmailutils/imapio/create.c (mu_imapio_create): Use MU_WRDSX_ constants to address ws_escape. * libmailutils/imapio/qstring.c: Likewise. * libmailutils/mailbox/mbx_default.c: Minor fix. * libmailutils/server/acl.c (acl_getvar): Rewrite according to the new API. * libmailutils/tests/wsp.c: Minor fix. * libmailutils/url/create.c (_mu_url_create_internal): Bugfix: alloc url->path. * libmu_sieve/extensions/list.c (retrieve_next_header): Use mu_wordsplit_get_words * libproto/mailer/prog.c (prog_getvar): Rewrite according to the new API. * libproto/mailer/smtp_gsasl.c (get_implemented_mechs): Remove unneeded assignment to ws.ws_wordv. * mh/folder.c: Use mu_wordsplit_get_words. * mh/mhn.c: Likewise. * movemail/movemail.c (movemail_getvar): Rewrite according to the new API.
Diffstat (limited to 'libmailutils/url')
-rw-r--r--libmailutils/url/create.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libmailutils/url/create.c b/libmailutils/url/create.c
index 182b8bd9e..95deca424 100644
--- a/libmailutils/url/create.c
+++ b/libmailutils/url/create.c
@@ -416,7 +416,12 @@ _mu_url_create_internal (struct mu_url_ctx *ctx, mu_url_t hint)
ctx->flags &= ~MU_URL_PARSE_HEXCODE;
if (mu_wordsplit (ctx->input + 1, &ws, MU_WRDSF_DEFFLAGS))
return errno;
- url->path = ws.ws_wordv[0];
+ url->path = strdup (ws.ws_wordv[0]);
+ if (!url->path)
+ {
+ mu_wordsplit_free (&ws);
+ return ENOMEM;
+ }
url->flags |= MU_URL_PATH;
url->qargc = ws.ws_wordc - 1;

Return to:

Send suggestions and report system problems to the System administrator.