fix: probable endless loop

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3816 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
s 2009-11-10 15:07:40 +00:00
parent 9c9e21e9cc
commit 3603a22917
1 changed files with 1 additions and 1 deletions

View File

@ -2008,7 +2008,7 @@ static size_t sc_pkcs15init_keybits(sc_pkcs15_bignum_t *bn)
if (!bn || !bn->len)
return 0;
bits = bn->len << 3;
for (mask = 0x80; !(bn->data[0] & mask); mask >>= 1)
for (mask = 0x80; mask && !(bn->data[0] & mask); mask >>= 1)
bits--;
return bits;
}