소스 검색

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

Rich Felker 11 년 전
부모
커밋
c4f49a6a72
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/ldso/dynlink.c

+ 1 - 1
src/ldso/dynlink.c

@@ -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;