Skip to content

Commit fed0b9f

Browse files
Fix wherelen handling in BIO_ADDR_rawmake AF_UNIX path
1 parent 0993768 commit fed0b9f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

crypto/bio/bio_addr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ int BIO_ADDR_rawmake(BIO_ADDR *ap, int family, const void *where,
110110
GUARD_PTR(where);
111111
// wherelen is expected to be the length of the path string
112112
// not including the terminating NUL.
113-
if (wherelen + 1 > sizeof(ap->s_un.sun_path)) {
113+
if (wherelen >= sizeof(ap->s_un.sun_path)) {
114114
return 0;
115115
}
116116
OPENSSL_cleanse(&ap->s_un, sizeof(ap->s_un));
117117
ap->s_un.sun_family = family;
118-
OPENSSL_strlcpy(ap->s_un.sun_path, where, wherelen);
118+
OPENSSL_memcpy(ap->s_un.sun_path, where, wherelen);
119119
return 1;
120120
}
121121
#endif

0 commit comments

Comments
 (0)