* grub-core/normal/crypto.c (grub_crypto_autoload): Prevent

infinite recursion using counter.
	* grub-core/lib/xzembed/xz_dec_stream.c (xz_dec_init): Defer s->crc32
	init to skip it if the magic check fails.
	(dec_stream_header): Init s->crc32.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-01-23 03:39:37 +01:00
parent 8f9d3a8c36
commit 7816a17ed1
3 changed files with 19 additions and 5 deletions

View file

@ -445,6 +445,8 @@ static enum xz_ret dec_stream_header(struct xz_dec *s)
return XZ_FORMAT_ERROR;
#ifndef GRUB_EMBED_DECOMPRESSOR
s->crc32 = grub_crypto_lookup_md_by_name ("CRC32");
if (s->crc32)
{
uint64_t hash_context[(s->crc32->contextsize + 7) / 8];
@ -958,10 +960,6 @@ struct xz_dec * xz_dec_init(uint32_t dict_max)
memset (s, 0, sizeof (*s));
#ifndef GRUB_EMBED_DECOMPRESSOR
s->crc32 = grub_crypto_lookup_md_by_name ("CRC32");
#endif
s->single_call = dict_max == 0;
#ifdef XZ_DEC_BCJ