wok view busybox/stuff/busybox-1.22-insmod.u @ rev 15780

busybox: fix unmappable insmod
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Jan 13 00:00:03 2014 +0100 (2014-01-13)
parents
children
line source
1 --- busybox-1.22.0/modutils/modutils.c
2 +++ busybox-1.22.0/modutils/modutils.c
3 @@ -160,7 +160,11 @@
4 mmaped = 1;
5 } else {
6 errno = ENOMEM; /* may be changed by e.g. open errors below */
7 - image = xmalloc_open_zipped_read_close(filename, &image_size);
8 + image = xmalloc_open_read_close(filename, &image_size);
9 + if (image && image_size >= 4 && strncmp(image+1,"ELF",3)) {
10 + free(image);
11 + image = xmalloc_open_zipped_read_close(filename, &image_size);
12 + }
13 if (!image)
14 return -errno;
15 }