APPS: fix load_certs_multifile() interpreting backslashes

Fixes #14622

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/14636)
This commit is contained in:
Dr. David von Oheimb 2021-03-21 23:23:23 +01:00 committed by Dr. David von Oheimb
parent 251c48183b
commit db89d8f04b

View File

@ -641,12 +641,8 @@ void* app_malloc(int sz, const char *what)
char *next_item(char *opt) /* in list separated by comma and/or space */
{
/* advance to separator (comma or whitespace), if any */
while (*opt != ',' && !isspace(*opt) && *opt != '\0') {
if (*opt == '\\' && opt[1] != '\0')
/* skip and unescape '\' escaped char */
memmove(opt, opt + 1, strlen(opt));
while (*opt != ',' && !isspace(*opt) && *opt != '\0')
opt++;
}
if (*opt != '\0') {
/* terminate current item */
*opt++ = '\0';