about summary refs log tree commit diff
path: root/src/ldso/dynlink.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2013-07-31 14:05:41 -0400
committerRich Felker <dalias@aerifal.cx>2013-07-31 14:05:41 -0400
commitc4f49a6a726fcd07bb15198ac4556100320934a9 (patch)
tree16222fd63198bb22489bbf8bc4067a1babcff875 /src/ldso/dynlink.c
parentd0c6cb05e71e624338571cda28f5c17d3ab0004c (diff)
downloadmusl-c4f49a6a726fcd07bb15198ac4556100320934a9.tar.gz
musl-c4f49a6a726fcd07bb15198ac4556100320934a9.tar.xz
musl-c4f49a6a726fcd07bb15198ac4556100320934a9.zip
fix bug where read error was treated as success reading library headers
Diffstat (limited to 'src/ldso/dynlink.c')
-rw-r--r--src/ldso/dynlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c
index 3c963e22..59ec5b79 100644
--- a/src/ldso/dynlink.c
+++ b/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;