Browse Source

Merge pull request #278 from loomy/master

lmtp on local socket: fix socketpath checks
merge-experiment
Hoà V. DINH 5 years ago
committed by GitHub
parent
commit
cc670add8e
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      src/data-types/connect.c

+ 5
- 1
src/data-types/connect.c View File

@ -190,7 +190,11 @@ int mail_unix_connect_socket(const char *path)
struct sockaddr_un sa;
int s;
if (!(memcpy(sa.sun_path, path, strlen(path)))) {
if (sizeof(sa.sun_path) <= strlen(path)) {
return -1;
}
if (!(memcpy(sa.sun_path, path, sizeof(sa.sun_path)))) {
return -1;
}
sa.sun_family = AF_UNIX;


Loading…
Cancel
Save