Skip to content

Commit

Permalink
[CRYPTO] cryptomgr: Fix parsing of recursive algorithms
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
herbertx authored and David S. Miller committed Oct 10, 2007
1 parent f19f511 commit 720a650
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crypto/cryptomgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval)
}

notnum = 1;
p++;
}

len = p - name;
Expand All @@ -151,7 +152,7 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval)
param->tb[i + 1] = &param->attrs[i].attr;
i++;

if (WARN_ON(i >= CRYPTO_MAX_ATTRS))
if (i >= CRYPTO_MAX_ATTRS)
goto err_free_param;

if (*p == ')')
Expand Down

0 comments on commit 720a650

Please sign in to comment.