diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-08-07 00:15:12 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-08-07 00:15:12 +0200 |
commit | fb96e44d2bcab18291197b465e97f5acc9a813a2 (patch) | |
tree | 55ec62deca14af7362e8eb613338143a65024590 | |
parent | 865b9382baf4d61a31e9fe679c151ea9c9719a7d (diff) | |
download | curl-bagder/smtp-parse-blank.tar.gz |
smtp_parse_address: handle blank input string properlybagder/smtp-parse-blank
-rw-r--r-- | lib/smtp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/smtp.c b/lib/smtp.c index 685513b3b..aea41bb4e 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -1760,8 +1760,10 @@ static CURLcode smtp_parse_address(struct connectdata *conn, const char *fqma, return CURLE_OUT_OF_MEMORY; length = strlen(dup); - if(dup[length - 1] == '>') - dup[length - 1] = '\0'; + if(length) { + if(dup[length - 1] == '>') + dup[length - 1] = '\0'; + } /* Extract the host name from the address (if we can) */ host->name = strpbrk(dup, "@"); |