Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
MergeDate: Tue Feb 24 14:04:17 2026
(Merged from https://github.com/openssl/openssl/pull/29612)
for (i = 0; i < len; i++) {
c = name[i];
if (c == '.') {
- /* Can not start a label with a . */
- if (part_len == 0)
+ /*
+ * Can not start a label with a .
+ * unless it is the very first character.
+ */
+ if (part_len == 0 && i != 0)
return 0;
/* Can not end a label with a - */
if (prev == '-')