0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-01-19 16:52:16 +00:00
2023-04-29 15:02:32 +09:00

17 lines
399 B
Diff

https://github.com/termux/termux-packages/issues/16476
--- a/read.c
+++ b/read.c
@@ -445,6 +445,11 @@
return -1;
}
+ if (S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode)) {
+ mandoc_msg(MANDOCERR_BADARG_BAD, 0, 0, "%s", strerror(EINVAL));
+ return -1;
+ }
+
/*
* If we're a regular file, try just reading in the whole entry
* via mmap(). This is faster than reading it into blocks, and