search for: load_one

Displaying 2 results from an estimated 2 matches for "load_one".

Did you mean: load_done
2010 Jul 14
1
[PATCH] gfxboot: fix buffer overrun when loading kernel/initramfs
...100644 --- a/com32/gfxboot/gfxboot.c +++ b/com32/gfxboot/gfxboot.c @@ -21,6 +21,7 @@ #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> +#include <minmax.h> #include <syslinux/loadfile.h> #include <syslinux/config.h> @@ -749,7 +750,7 @@ void *load_one(char *file, ssize_t *file_size) if(size) { buf = malloc(size); for(i = 1, cur = 0 ; cur < size && i > 0; cur += i) { - i = save_read(fd, buf + cur, CHUNK_SIZE); + i = save_read(fd, buf + cur, min(CHUNK_SIZE, size - cur)); if(i == -1) break; gfx_pro...
2010 Apr 09
2
[PATCH] gfxboot: support MENU LABEL statement
...(+), 19 deletions(-) diff --git a/com32/gfxboot/gfxboot.c b/com32/gfxboot/gfxboot.c index bfdd8cc..640422b 100644 --- a/com32/gfxboot/gfxboot.c +++ b/com32/gfxboot/gfxboot.c @@ -165,7 +165,7 @@ void gfx_done(void); int gfx_input(void); ssize_t save_read(int fd, void *buf, size_t size); void *load_one(char *file, ssize_t *file_size); -void boot(void); +void boot(int index); void boot_entry(menu_t *menu_ptr, char *arg); @@ -234,7 +234,7 @@ int main(int argc, char **argv) } // does not return if it succeeds - boot(); + boot(menu_index); } if(argc > 2) show_messag...