Use BUF_strlcpy() instead of strcpy().
[openssl.git] / apps / enc.c
index ae18452e86338e6bb5a8928e47a91670c08493f9..69f4bebcb911e6ef12d9937613c5d91cde4d146c 100644 (file)
@@ -373,9 +373,9 @@ bad:
                        {
                        char buf[200];
 
-                       sprintf(buf,"enter %s %s password:",
-                               OBJ_nid2ln(EVP_CIPHER_nid(cipher)),
-                               (enc)?"encryption":"decryption");
+                       BIO_snprintf(buf,sizeof buf,"enter %s %s password:",
+                                    OBJ_nid2ln(EVP_CIPHER_nid(cipher)),
+                                    (enc)?"encryption":"decryption");
                        strbuf[0]='\0';
                        i=EVP_read_pw_string((char *)strbuf,SIZE,buf,enc);
                        if (i == 0)