* 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

@ -38,7 +38,14 @@ grub_crypto_autoload (const char *name)
{
struct load_spec *cur;
grub_dl_t mod;
static int depth = 0;
/* Some bufio of filesystems may want some crypto modules.
It may result in infinite recursion. Hence this check. */
if (depth)
return;
depth++;
for (cur = crypto_specs; cur; cur = cur->next)
if (grub_strcasecmp (name, cur->name) == 0)
{
@ -47,6 +54,7 @@ grub_crypto_autoload (const char *name)
grub_dl_ref (mod);
grub_errno = GRUB_ERR_NONE;
}
depth--;
}
static void