From e4aa83204502df229def8f1b639039dfa5fe33a1 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Fri, 24 Nov 2023 21:47:28 +0100 Subject: LibC: Fill new allocations with random data and fix a bug The bug was noticed as a result of this new randomization of allocations. --- userland/libc/stdio/fopen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'userland/libc/stdio') diff --git a/userland/libc/stdio/fopen.c b/userland/libc/stdio/fopen.c index d31082d..71d14db 100644 --- a/userland/libc/stdio/fopen.c +++ b/userland/libc/stdio/fopen.c @@ -44,7 +44,7 @@ FILE *fopen(const char *pathname, const char *mode) { struct stat s; stat(pathname, &s); - FILE *r = malloc(sizeof(FILE)); + FILE *r = calloc(1, sizeof(FILE)); r->read = read_fd; r->write = write_fd; r->seek = seek_fd; -- cgit v1.2.3