extern int stdin_ungetc(int);
extern uschar *string_append(uschar *, int *, int *, int, ...);
extern uschar *string_append_listele(uschar *, uschar, const uschar *);
+extern uschar *string_append_listele_n(uschar *, uschar, const uschar *, unsigned);
extern uschar *string_base62(unsigned long int);
extern uschar *string_cat(uschar *, int *, int *, const uschar *, int);
extern uschar *string_copy_dnsdomain(uschar *);
new[off] = '\0';
return new;
}
+
+
+static const uschar *
+Ustrnchr(const uschar * s, int c, unsigned * len)
+{
+while (*len)
+ {
+ if (!*s) return NULL;
+ if (*s == c) return s;
+ s++;
+ *len--;
+ }
+return NULL;
+}
+
+uschar *
+string_append_listele_n(uschar * list, uschar sep, const uschar * ele,
+ unsigned len)
+{
+uschar * new = NULL;
+int sz = 0, off = 0;
+const uschar * sp;
+
+if (list)
+ {
+ new = string_cat(new, &sz, &off, list, Ustrlen(list));
+ new = string_cat(new, &sz, &off, &sep, 1);
+ }
+
+while((sp = Ustrnchr(ele, sep, &len)))
+ {
+ new = string_cat(new, &sz, &off, ele, sp-ele+1);
+ new = string_cat(new, &sz, &off, &sep, 1);
+ ele = sp+1;
+ len--;
+ }
+new = string_cat(new, &sz, &off, ele, len);
+new[off] = '\0';
+return new;
+}
#endif /* COMPILE_UTILITY */
ACCESS_DESCRIPTION * ad = sk_ACCESS_DESCRIPTION_value(ads, i);
if (ad && OBJ_obj2nid(ad->method) == NID_ad_OCSP)
- list = string_append_listele(list, sep,
- ASN1_STRING_data(ad->location->d.ia5));
+ {
+ uschar * ele = ASN1_STRING_data(ad->location->d.ia5);
+ int len = ASN1_STRING_length(ad->location->d.ia5);
+ list = string_append_listele_n(list, sep, ele, len);
+ }
}
+sk_ACCESS_DESCRIPTION_free(ads);
return list;
}
if ( (np = sk_GENERAL_NAME_value(names, j))
&& np->type == GEN_URI
)
- list = string_append_listele(list, sep,
- ASN1_STRING_data(np->d.uniformResourceIdentifier));
+ {
+ uschar * ele = ASN1_STRING_data(np->d.uniformResourceIdentifier);
+ int len = ASN1_STRING_length(np->d.uniformResourceIdentifier);
+ list = string_append_listele_n(list, sep, ele, len);
+ }
}
+sk_DIST_POINT_free(dps);
return list;
}