Skip to content

Commit 40c0437

Browse files
committed
Merge pull request trusteddomainproject#239 from aafbsd/develop
Fix: do not use strlcpy() if buffers overlap
2 parents 49adf9e + 2454682 commit 40c0437

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

opendkim/opendkim.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12358,8 +12358,10 @@ mlfi_eoh(SMFICTX *ctx)
1235812358

1235912359
if (domainok)
1236012360
{
12361-
strlcpy((char *) dfc->mctx_domain, p,
12362-
sizeof dfc->mctx_domain);
12361+
// We must not use strlcpy() here since
12362+
// src and dst overlap.
12363+
char* p2 = dfc->mctx_domain;
12364+
while( (*p2++ = *p++) );
1236312365
break;
1236412366
}
1236512367
}

0 commit comments

Comments
 (0)