PR: 1861
authorDr. Stephen Henson <steve@openssl.org>
Thu, 12 Mar 2009 17:09:46 +0000 (17:09 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Thu, 12 Mar 2009 17:09:46 +0000 (17:09 +0000)
l must be > 0 or array will be accessed out of bounds.

apps/apps.c

index 367eb177e17f4fa9c7f8872604915c6d01a67f35..498722a5a2583bec73ac2ad4c534abd76e31ffb1 100644 (file)
@@ -2428,7 +2428,7 @@ static void readbn(BIGNUM **bn, BIO *bconn)
        int l;
 
        l = BIO_gets(bconn, buf, sizeof buf);
-       assert(l >= 0);
+       assert(l > 0);
        assert(buf[l-1] == '\n');
        buf[l-1] = '\0';
        BN_hex2bn(bn, buf);