提交 c4f49a6a 编写于 作者: R Rich Felker

fix bug where read error was treated as success reading library headers

上级 d0c6cb05
......@@ -318,7 +318,7 @@ static void *map_library(int fd, struct dso *dso)
size_t i;
ssize_t l = read(fd, buf, sizeof buf);
if (l<sizeof *eh) return 0;
if (l<(int)sizeof *eh) return 0;
eh = buf;
phsize = eh->e_phentsize * eh->e_phnum;
if (phsize + sizeof *eh > l) return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册