diff --git a/tests/mkfifo.c b/tests/mkfifo.c index ad4dec2a9c..318419a507 100644 --- a/tests/mkfifo.c +++ b/tests/mkfifo.c @@ -11,7 +11,9 @@ int main(void) { char temp[] = "/tmp/stattest-XXXXXX"; const char file[] = "/mkfifo_fifo"; int len = sizeof(temp) + sizeof(file); + char* path = malloc(len * sizeof(char)); + path[0] = '\0'; if (path == NULL) { fprintf(stderr, "Could not allocate: %s\n", strerror(errno)); diff --git a/tests/mknod.c b/tests/mknod.c index 58e279f688..50d533a2a2 100644 --- a/tests/mknod.c +++ b/tests/mknod.c @@ -11,7 +11,9 @@ int main(void) { char temp[] = "/tmp/stattest-XXXXXX"; const char file[] = "/mknod"; int len = sizeof(temp) + sizeof(file); + char* path = malloc(len * sizeof(char)); + path[0] = '\0'; if (path == NULL) { fprintf(stderr, "Could not allocate: %s\n", strerror(errno)); diff --git a/tests/mknodat.c b/tests/mknodat.c index b449a30d5b..ad2798624f 100644 --- a/tests/mknodat.c +++ b/tests/mknodat.c @@ -12,7 +12,9 @@ int main(void) { const char separator[] = "/"; const char file[] = "mknod"; // relative int len = sizeof(temp) + sizeof(file) + sizeof(separator); + char* path = malloc(len * sizeof(char)); + path[0] = '\0'; if (path == NULL) { fprintf(stderr, "Could not allocate: %s\n", strerror(errno));