From c187ba994b94d7c21e09dafdca8c2f3cb0a6af81 Mon Sep 17 00:00:00 2001 From: itojun Date: Mon, 14 Jul 2003 13:24:00 +0000 Subject: [PATCH] use bounded string op (only one sprintf remains - still no clue) --- crypto/dist/openssl/crypto/pem/pem_lib.c | 12 ++++++------ crypto/dist/openssl/crypto/x509/by_dir.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crypto/dist/openssl/crypto/pem/pem_lib.c b/crypto/dist/openssl/crypto/pem/pem_lib.c index 01759f75c3b5..ef16b5e9c74e 100644 --- a/crypto/dist/openssl/crypto/pem/pem_lib.c +++ b/crypto/dist/openssl/crypto/pem/pem_lib.c @@ -140,9 +140,9 @@ void PEM_proc_type(char *buf, int type) else str="BAD-TYPE"; - strcat(buf,"Proc-Type: 4,"); - strcat(buf,str); - strcat(buf,"\n"); + strlcat(buf, "Proc-Type: 4,", PEM_BUFSIZE); + strlcat(buf, str, PEM_BUFSIZE); + strlcat(buf, "\n", PEM_BUFSIZE); } void PEM_dek_info(char *buf, const char *type, int len, char *str) @@ -151,9 +151,9 @@ void PEM_dek_info(char *buf, const char *type, int len, char *str) long i; int j; - strcat(buf,"DEK-Info: "); - strcat(buf,type); - strcat(buf,","); + strlcat(buf, "DEK-Info: ", PEM_BUFSIZE); + strlcat(buf, type, PEM_BUFSIZE); + strlcat(buf, ",", PEM_BUFSIZE); j=strlen(buf); for (i=0; idata,"%s/%08lx.%s%d",ctx->dirs[i],h, - postfix,k); + snprintf(b->data, b->max, "%s/%08lx.%s%d", + ctx->dirs[i], h, postfix, k); k++; if (stat(b->data,&st) < 0) break;