Skip to content

Commit e8f25f8

Browse files
authored
Fix asan.test_fs_trackingdelegate by fixing open() call (#15021)
It turns out that when O_CREAT is given to open(), one must also provide the flags with which to create the file. Not providing that varargs param is apparently undefined behavior, and the musl open() method will end up reading a vararg that does not exist, which leads to a null deref.
1 parent c25daad commit e8f25f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/fs/test_trackingdelegate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ int main() {
123123
read(fd, output, 100);
124124
printf("read returned %s\n", output);
125125
close(fd);
126-
fd = open("/renamed.txt", O_CREAT);
126+
fd = open("/renamed.txt", O_CREAT, 0666);
127127
close(fd);
128128
fd = open("/renamed.txt", O_EXCL | O_WRONLY);
129129
close(fd);

0 commit comments

Comments
 (0)