Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157782805
D5112.id12809.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
663 B
Referenced Files
None
Subscribers
None
D5112.id12809.diff
View Options
Index: libexec/rtld-elf/map_object.c
===================================================================
--- libexec/rtld-elf/map_object.c
+++ libexec/rtld-elf/map_object.c
@@ -327,6 +327,18 @@
get_elf_header(int fd, const char *path)
{
Elf_Ehdr *hdr;
+ struct stat sb;
+
+ /* Make sure file has enough data for the ELF header */
+ if (fstat(fd, &sb) == -1) {
+ _rtld_error("%s: get stat error: %s", path,
+ rtld_strerror(errno));
+ return (NULL);
+ }
+ if (sb.st_size < sizeof(Elf_Ehdr)) {
+ _rtld_error("%s: invalid file format", path);
+ return (NULL);
+ }
hdr = mmap(NULL, PAGE_SIZE, PROT_READ, MAP_PRIVATE | MAP_PREFAULT_READ,
fd, 0);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, May 26, 3:21 AM (10 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33523243
Default Alt Text
D5112.id12809.diff (663 B)
Attached To
Mode
D5112: dlopen(3) crashes when opening empty .so
Attached
Detach File
Event Timeline
Log In to Comment