efi: ensure 8 byte alignment of buffer, as ReadBlocks() method will fail otherwise

This commit is contained in:
cinap_lenrek 2016-05-22 21:52:04 +02:00
parent 66b1a83b74
commit 4e5b596bba
2 changed files with 5 additions and 3 deletions

View file

@ -171,9 +171,10 @@ Foundpvd:
static void* static void*
isoopen(char *path) isoopen(char *path)
{ {
static Extend ex[1]; static uchar buf[sizeof(Extend)+8];
Extend *ex = (Extend*)((uintptr)(buf+7)&~7);
if(isowalk(ex, path)) if(isowalk(ex, path))
return nil; return nil;
return ex; return ex;
} }

View file

@ -306,7 +306,8 @@ tftpopen(Tftp *t, char *path)
static void* static void*
pxeopen(char *name) pxeopen(char *name)
{ {
static Tftp t[1]; static uchar buf[sizeof(Tftp)+8];
Tftp *t = (Tftp*)((uintptr)(buf+7)&~7);
memset(t, 0, sizeof(Tftp)); memset(t, 0, sizeof(Tftp));