summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/t_req.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/asn1/t_req.c')
-rw-r--r--src/lib/libcrypto/asn1/t_req.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/libcrypto/asn1/t_req.c b/src/lib/libcrypto/asn1/t_req.c
index 739f272ecf..eca97e00cb 100644
--- a/src/lib/libcrypto/asn1/t_req.c
+++ b/src/lib/libcrypto/asn1/t_req.c
@@ -116,7 +116,8 @@ int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags, unsigned long
116 l=0; 116 l=0;
117 for (i=0; i<ri->version->length; i++) 117 for (i=0; i<ri->version->length; i++)
118 { l<<=8; l+=ri->version->data[i]; } 118 { l<<=8; l+=ri->version->data[i]; }
119 sprintf(str,"%8sVersion: %s%lu (%s0x%lx)\n","",neg,l,neg,l); 119 snprintf(str,sizeof str,"%8sVersion: %s%lu (%s0x%lx)\n","",neg,
120 l,neg,l);
120 if (BIO_puts(bp,str) <= 0) goto err; 121 if (BIO_puts(bp,str) <= 0) goto err;
121 } 122 }
122 if(!(cflag & X509_FLAG_NO_SUBJECT)) 123 if(!(cflag & X509_FLAG_NO_SUBJECT))
@@ -168,13 +169,13 @@ int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags, unsigned long
168 if(!(cflag & X509_FLAG_NO_ATTRIBUTES)) 169 if(!(cflag & X509_FLAG_NO_ATTRIBUTES))
169 { 170 {
170 /* may not be */ 171 /* may not be */
171 sprintf(str,"%8sAttributes:\n",""); 172 snprintf(str,sizeof str,"%8sAttributes:\n","");
172 if (BIO_puts(bp,str) <= 0) goto err; 173 if (BIO_puts(bp,str) <= 0) goto err;
173 174
174 sk=x->req_info->attributes; 175 sk=x->req_info->attributes;
175 if (sk_X509_ATTRIBUTE_num(sk) == 0) 176 if (sk_X509_ATTRIBUTE_num(sk) == 0)
176 { 177 {
177 sprintf(str,"%12sa0:00\n",""); 178 snprintf(str,sizeof str,"%12sa0:00\n","");
178 if (BIO_puts(bp,str) <= 0) goto err; 179 if (BIO_puts(bp,str) <= 0) goto err;
179 } 180 }
180 else 181 else
@@ -190,7 +191,7 @@ int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags, unsigned long
190 a=sk_X509_ATTRIBUTE_value(sk,i); 191 a=sk_X509_ATTRIBUTE_value(sk,i);
191 if(X509_REQ_extension_nid(OBJ_obj2nid(a->object))) 192 if(X509_REQ_extension_nid(OBJ_obj2nid(a->object)))
192 continue; 193 continue;
193 sprintf(str,"%12s",""); 194 snprintf(str,sizeof str,"%12s","");
194 if (BIO_puts(bp,str) <= 0) goto err; 195 if (BIO_puts(bp,str) <= 0) goto err;
195 if ((j=i2a_ASN1_OBJECT(bp,a->object)) > 0) 196 if ((j=i2a_ASN1_OBJECT(bp,a->object)) > 0)
196 { 197 {