]> err.no Git - linux-2.6/commitdiff
[CRYPTO] cryptomgr: Fix parsing of recursive algorithms
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 28 Sep 2007 01:06:11 +0000 (09:06 +0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:55:45 +0000 (16:55 -0700)
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>
crypto/cryptomgr.c

index c83884fec5f928fd8e75bf8a82205411c4004dff..e5e3cf848d425ad0c3fa8584e323b51d9135221b 100644 (file)
@@ -129,6 +129,7 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval)
                        }
 
                        notnum = 1;
+                       p++;
                }
 
                len = p - name;
@@ -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 == ')')