summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2014-12-25 13:30:12 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2014-12-25 20:12:12 +0000
commitbfbad1dddf8b26ef0e14e48a36edc4a8bf1425e4 (patch)
treed4a76f7144e7f6e3dba6135f15173fd68fce5024 /src
parent3c71915d2f4f00f7e159808c70ae2513f03b7be4 (diff)
Fix null-indirection in certextract expansion
Found-by: Roman Rybalko
Diffstat (limited to 'src')
-rw-r--r--src/src/tls.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/src/tls.c b/src/src/tls.c
index 305eaa410..b3d088df3 100644
--- a/src/src/tls.c
+++ b/src/src/tls.c
@@ -246,7 +246,7 @@ NOTE: We modify the supplied dn string during operation.
Arguments:
dn Distinguished Name string
- mod string containing optional list-sep and
+ mod list containing optional output list-sep and
field selector match, comma-separated
Return:
allocated string with list of matching fields,
@@ -267,13 +267,15 @@ while ((ele = string_nextinlist(&mod, &insep, NULL, 0)))
if (ele[0] != '>')
match = ele; /* field tag to match */
else if (ele[1])
- outsep = ele[1]; /* nondefault separator */
+ outsep = ele[1]; /* nondefault output separator */
dn_to_list(dn);
insep = ',';
-len = Ustrlen(match);
+len = match ? Ustrlen(match) : -1;
while ((ele = string_nextinlist(&dn, &insep, NULL, 0)))
- if (Ustrncmp(ele, match, len) == 0 && ele[len] == '=')
+ if ( !match
+ || Ustrncmp(ele, match, len) == 0 && ele[len] == '='
+ )
list = string_append_listele(list, outsep, ele+len+1);
return list;
}