[CRYPTO] cryptomgr: Fix parsing of recursive algorithms

As Joy Latten points out, inner algorithm parameters will miss the closing
bracket which will also cause the outer algorithm to terminate prematurely.

This patch fixes that also kills the WARN_ON if the number of parameters
exceed the maximum as that is a user error.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Herbert Xu 2007-09-28 09:06:11 +08:00 коммит произвёл David S. Miller
Родитель f19f5111c9
Коммит 720a650f8a
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -129,6 +129,7 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval)
} }
notnum = 1; notnum = 1;
p++;
} }
len = p - name; len = p - name;
@ -151,7 +152,7 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval)
param->tb[i + 1] = &param->attrs[i].attr; param->tb[i + 1] = &param->attrs[i].attr;
i++; i++;
if (WARN_ON(i >= CRYPTO_MAX_ATTRS)) if (i >= CRYPTO_MAX_ATTRS)
goto err_free_param; goto err_free_param;
if (*p == ')') if (*p == ')')