summaryrefslogtreecommitdiffstats
path: root/apps/ts.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2009-09-13 11:27:27 +0000
committerDr. Stephen Henson <steve@openssl.org>2009-09-13 11:27:27 +0000
commit80afb40ae34594b23d3c2cbeb8f653aac4634eca (patch)
treecefa55bf1b9fe6af76ce2ac7be5cf09449bfca18 /apps/ts.c
parent3333428b44a0c4e21451cdaf6978933df3dd203a (diff)
Submitted by: Julia Lawall <julia@diku.dk>
The functions ENGINE_ctrl(), OPENSSL_isservice(), EVP_PKEY_sign(), CMS_get1_RecipientRequest() and RAND_bytes() can return <=0 on error fix so the return code is checked correctly.
Diffstat (limited to 'apps/ts.c')
-rw-r--r--apps/ts.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/ts.c b/apps/ts.c
index d73b4eb5ad..bedb602fd5 100644
--- a/apps/ts.c
+++ b/apps/ts.c
@@ -649,7 +649,7 @@ static ASN1_INTEGER *create_nonce(int bits)
/* Generating random byte sequence. */
if (len > (int)sizeof(buf)) goto err;
- if (!RAND_bytes(buf, len)) goto err;
+ if (RAND_bytes(buf, len) <= 0) goto err;
/* Find the first non-zero byte and creating ASN1_INTEGER object. */
for (i = 0; i < len && !buf[i]; ++i);