* grub-core/fs/squash4.c (lzo_decompress): Set grub_errno on error.
Allocate at lest 8192 for temporary buffer as required for lzo.
This commit is contained in:
parent
daa59f47f6
commit
b282dfe5ac
2 changed files with 10 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2012-04-25 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/fs/squash4.c (lzo_decompress): Set grub_errno on error.
|
||||
Allocate at lest 8192 for temporary buffer as required for lzo.
|
||||
|
||||
2012-04-25 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/fs/fat.c (grub_fat_mount): Don't add logical_sector_bits
|
||||
|
|
|
@ -298,13 +298,17 @@ lzo_decompress (char *inbuf, grub_size_t insize, grub_off_t off,
|
|||
lzo_uint usize = data->blksz;
|
||||
grub_uint8_t *udata;
|
||||
|
||||
udata = grub_malloc (data->blksz);
|
||||
if (usize < 8192)
|
||||
usize = 8192;
|
||||
|
||||
udata = grub_malloc (usize);
|
||||
if (!udata)
|
||||
return -1;
|
||||
|
||||
if (lzo1x_decompress_safe ((grub_uint8_t *) inbuf,
|
||||
insize, udata, &usize, NULL) != LZO_E_OK)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_FS, "incorrect compressed chunk");
|
||||
grub_free (udata);
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue