Skip to content

Commit

Permalink
seatd-launch: Use snprintf for socket path
Browse files Browse the repository at this point in the history
We also reduce the size of the buffer from 256 bytes to a much more
reasonable 32 bytes.
  • Loading branch information
kennylevinsen committed Feb 21, 2022
1 parent 7cffe07 commit 615c10c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions seatd-launch/seatd-launch.c
Expand Up @@ -42,8 +42,8 @@ int main(int argc, char *argv[]) {
}
char **command = &argv[optind];

char sockpath[256];
sprintf(sockpath, "/tmp/seatd.%d.sock", getpid());
char sockpath[32];
snprintf(sockpath, sizeof sockpath, "/tmp/seatd.%d.sock", getpid());

unlink(sockpath);

Expand Down

0 comments on commit 615c10c

Please sign in to comment.