Use BUF_strlcpy() instead of strcpy().
[openssl.git] / crypto / x509 / by_dir.c
index 448bd7e69cca5a17c0179b03fb13e518ea1ea270..a9752d6a030bfea9d0d037b4f6a7bf8dc97c4918 100644 (file)
@@ -302,8 +302,9 @@ static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name,
                k=0;
                for (;;)
                        {
-                       sprintf(b->data,"%s/%08lx.%s%d",ctx->dirs[i],h,
-                               postfix,k);
+                       BIO_snprintf(b->data,b->max,
+                                    "%s/%08lx.%s%d",ctx->dirs[i],h,
+                                    postfix,k);
                        k++;
                        if (stat(b->data,&st) < 0)
                                break;