summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbeck <>2014-04-19 00:41:38 +0000
committerbeck <>2014-04-19 00:41:38 +0000
commitf15b58ab9c9f635ba829753251c22b3da4683b00 (patch)
tree174c4c233f06a12ea563fd4e4c48bc26d4bdede3
parent4855ea84e69fe2edcf4d523233d15c950bd77e4d (diff)
downloadopenbsd-f15b58ab9c9f635ba829753251c22b3da4683b00.tar.gz
openbsd-f15b58ab9c9f635ba829753251c22b3da4683b00.tar.bz2
openbsd-f15b58ab9c9f635ba829753251c22b3da4683b00.zip
use intrinsic strlcpy and strlcat everywhere so we only have one set of
funcitons to check for incorrect use. keep BUF_strlcpy and BUF_strlcat for API comptibility only. ok tedu@
-rw-r--r--src/lib/libcrypto/asn1/a_time.c6
-rw-r--r--src/lib/libcrypto/bio/b_dump.c14
-rw-r--r--src/lib/libcrypto/bio/bss_file.c10
-rw-r--r--src/lib/libcrypto/conf/conf_def.c4
-rw-r--r--src/lib/libcrypto/dso/dso_lib.c4
-rw-r--r--src/lib/libcrypto/err/err.c2
-rw-r--r--src/lib/libcrypto/evp/evp_pbe.c2
-rw-r--r--src/lib/libcrypto/objects/obj_dat.c6
-rw-r--r--src/lib/libcrypto/pem/pem_lib.c12
-rw-r--r--src/lib/libcrypto/rand/randfile.c2
-rw-r--r--src/lib/libcrypto/ui/ui_lib.c12
-rw-r--r--src/lib/libcrypto/x509v3/v3_info.c6
-rw-r--r--src/lib/libssl/src/apps/apps.c4
-rw-r--r--src/lib/libssl/src/apps/ca.c16
-rw-r--r--src/lib/libssl/src/apps/engine.c4
-rw-r--r--src/lib/libssl/src/apps/pkcs12.c4
-rw-r--r--src/lib/libssl/src/apps/req.c16
-rw-r--r--src/lib/libssl/src/apps/s_socket.c2
-rw-r--r--src/lib/libssl/src/apps/x509.c6
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_time.c6
-rw-r--r--src/lib/libssl/src/crypto/bio/b_dump.c14
-rw-r--r--src/lib/libssl/src/crypto/bio/bss_file.c10
-rw-r--r--src/lib/libssl/src/crypto/conf/conf_def.c4
-rw-r--r--src/lib/libssl/src/crypto/dso/dso_lib.c4
-rw-r--r--src/lib/libssl/src/crypto/err/err.c2
-rw-r--r--src/lib/libssl/src/crypto/evp/evp_pbe.c2
-rw-r--r--src/lib/libssl/src/crypto/objects/obj_dat.c6
-rw-r--r--src/lib/libssl/src/crypto/pem/pem_lib.c12
-rw-r--r--src/lib/libssl/src/crypto/rand/randfile.c2
-rw-r--r--src/lib/libssl/src/crypto/ui/ui_lib.c12
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_info.c6
31 files changed, 106 insertions, 106 deletions
diff --git a/src/lib/libcrypto/asn1/a_time.c b/src/lib/libcrypto/asn1/a_time.c
index f3f28369f4..1978e8d3dc 100644
--- a/src/lib/libcrypto/asn1/a_time.c
+++ b/src/lib/libcrypto/asn1/a_time.c
@@ -147,10 +147,10 @@ ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZE
147 newlen = t->length + 2 + 1; 147 newlen = t->length + 2 + 1;
148 str = (char *)ret->data; 148 str = (char *)ret->data;
149 /* Work out the century and prepend */ 149 /* Work out the century and prepend */
150 if (t->data[0] >= '5') BUF_strlcpy(str, "19", newlen); 150 if (t->data[0] >= '5') strlcpy(str, "19", newlen);
151 else BUF_strlcpy(str, "20", newlen); 151 else strlcpy(str, "20", newlen);
152 152
153 BUF_strlcat(str, (char *)t->data, newlen); 153 strlcat(str, (char *)t->data, newlen);
154 154
155 return ret; 155 return ret;
156} 156}
diff --git a/src/lib/libcrypto/bio/b_dump.c b/src/lib/libcrypto/bio/b_dump.c
index ff75069df8..61c9fe20a3 100644
--- a/src/lib/libcrypto/bio/b_dump.c
+++ b/src/lib/libcrypto/bio/b_dump.c
@@ -107,29 +107,29 @@ BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u),
107 rows++; 107 rows++;
108 for (i = 0; i < rows; i++) { 108 for (i = 0; i < rows; i++) {
109 buf[0] = '\0'; /* start with empty string */ 109 buf[0] = '\0'; /* start with empty string */
110 BUF_strlcpy(buf, str, sizeof buf); 110 strlcpy(buf, str, sizeof buf);
111 (void) snprintf(tmp, sizeof tmp, "%04x - ", i*dump_width); 111 (void) snprintf(tmp, sizeof tmp, "%04x - ", i*dump_width);
112 BUF_strlcat(buf, tmp, sizeof buf); 112 strlcat(buf, tmp, sizeof buf);
113 for (j = 0; j < dump_width; j++) { 113 for (j = 0; j < dump_width; j++) {
114 if (((i*dump_width) + j) >= len) { 114 if (((i*dump_width) + j) >= len) {
115 BUF_strlcat(buf, " ", sizeof buf); 115 strlcat(buf, " ", sizeof buf);
116 } else { 116 } else {
117 ch = ((unsigned char)*(s + i*dump_width + j)) & 0xff; 117 ch = ((unsigned char)*(s + i*dump_width + j)) & 0xff;
118 (void) snprintf(tmp, sizeof tmp, "%02x%c", ch, 118 (void) snprintf(tmp, sizeof tmp, "%02x%c", ch,
119 j == 7 ? '-' : ' '); 119 j == 7 ? '-' : ' ');
120 BUF_strlcat(buf, tmp, sizeof buf); 120 strlcat(buf, tmp, sizeof buf);
121 } 121 }
122 } 122 }
123 BUF_strlcat(buf, " ", sizeof buf); 123 strlcat(buf, " ", sizeof buf);
124 for (j = 0; j < dump_width; j++) { 124 for (j = 0; j < dump_width; j++) {
125 if (((i*dump_width) + j) >= len) 125 if (((i*dump_width) + j) >= len)
126 break; 126 break;
127 ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff; 127 ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff;
128 (void) snprintf(tmp, sizeof tmp, "%c", 128 (void) snprintf(tmp, sizeof tmp, "%c",
129 ((ch >= ' ') && (ch <= '~')) ? ch : '.'); 129 ((ch >= ' ') && (ch <= '~')) ? ch : '.');
130 BUF_strlcat(buf, tmp, sizeof buf); 130 strlcat(buf, tmp, sizeof buf);
131 } 131 }
132 BUF_strlcat(buf, "\n", sizeof buf); 132 strlcat(buf, "\n", sizeof buf);
133 /* if this is the last call then update the ddt_dump thing so 133 /* if this is the last call then update the ddt_dump thing so
134 * that we will move the selection point in the debug window 134 * that we will move the selection point in the debug window
135 */ 135 */
diff --git a/src/lib/libcrypto/bio/bss_file.c b/src/lib/libcrypto/bio/bss_file.c
index 995c623341..acc746260e 100644
--- a/src/lib/libcrypto/bio/bss_file.c
+++ b/src/lib/libcrypto/bio/bss_file.c
@@ -246,14 +246,14 @@ file_ctrl(BIO *b, int cmd, long num, void *ptr)
246 b->shutdown = (int)num&BIO_CLOSE; 246 b->shutdown = (int)num&BIO_CLOSE;
247 if (num & BIO_FP_APPEND) { 247 if (num & BIO_FP_APPEND) {
248 if (num & BIO_FP_READ) 248 if (num & BIO_FP_READ)
249 BUF_strlcpy(p, "a+", sizeof p); 249 strlcpy(p, "a+", sizeof p);
250 else BUF_strlcpy(p, "a", sizeof p); 250 else strlcpy(p, "a", sizeof p);
251 } else if ((num & BIO_FP_READ) && (num & BIO_FP_WRITE)) 251 } else if ((num & BIO_FP_READ) && (num & BIO_FP_WRITE))
252 BUF_strlcpy(p, "r+", sizeof p); 252 strlcpy(p, "r+", sizeof p);
253 else if (num & BIO_FP_WRITE) 253 else if (num & BIO_FP_WRITE)
254 BUF_strlcpy(p, "w", sizeof p); 254 strlcpy(p, "w", sizeof p);
255 else if (num & BIO_FP_READ) 255 else if (num & BIO_FP_READ)
256 BUF_strlcpy(p, "r", sizeof p); 256 strlcpy(p, "r", sizeof p);
257 else { 257 else {
258 BIOerr(BIO_F_FILE_CTRL, BIO_R_BAD_FOPEN_MODE); 258 BIOerr(BIO_F_FILE_CTRL, BIO_R_BAD_FOPEN_MODE);
259 ret = 0; 259 ret = 0;
diff --git a/src/lib/libcrypto/conf/conf_def.c b/src/lib/libcrypto/conf/conf_def.c
index 39e8b8e521..26aee50a45 100644
--- a/src/lib/libcrypto/conf/conf_def.c
+++ b/src/lib/libcrypto/conf/conf_def.c
@@ -230,7 +230,7 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
230 CONFerr(CONF_F_DEF_LOAD_BIO,ERR_R_MALLOC_FAILURE); 230 CONFerr(CONF_F_DEF_LOAD_BIO,ERR_R_MALLOC_FAILURE);
231 goto err; 231 goto err;
232 } 232 }
233 BUF_strlcpy(section,"default",10); 233 strlcpy(section,"default",10);
234 234
235 if (_CONF_new_data(conf) == 0) 235 if (_CONF_new_data(conf) == 0)
236 { 236 {
@@ -384,7 +384,7 @@ again:
384 ERR_R_MALLOC_FAILURE); 384 ERR_R_MALLOC_FAILURE);
385 goto err; 385 goto err;
386 } 386 }
387 BUF_strlcpy(v->name,pname,strlen(pname)+1); 387 strlcpy(v->name,pname,strlen(pname)+1);
388 if (!str_copy(conf,psection,&(v->value),start)) goto err; 388 if (!str_copy(conf,psection,&(v->value),start)) goto err;
389 389
390 if (strcmp(psection,section) != 0) 390 if (strcmp(psection,section) != 0)
diff --git a/src/lib/libcrypto/dso/dso_lib.c b/src/lib/libcrypto/dso/dso_lib.c
index 00e65938b9..2f77242d47 100644
--- a/src/lib/libcrypto/dso/dso_lib.c
+++ b/src/lib/libcrypto/dso/dso_lib.c
@@ -373,7 +373,7 @@ int DSO_set_filename(DSO *dso, const char *filename)
373 DSOerr(DSO_F_DSO_SET_FILENAME,ERR_R_MALLOC_FAILURE); 373 DSOerr(DSO_F_DSO_SET_FILENAME,ERR_R_MALLOC_FAILURE);
374 return(0); 374 return(0);
375 } 375 }
376 BUF_strlcpy(copied, filename, strlen(filename) + 1); 376 strlcpy(copied, filename, strlen(filename) + 1);
377 if(dso->filename) 377 if(dso->filename)
378 free(dso->filename); 378 free(dso->filename);
379 dso->filename = copied; 379 dso->filename = copied;
@@ -432,7 +432,7 @@ char *DSO_convert_filename(DSO *dso, const char *filename)
432 ERR_R_MALLOC_FAILURE); 432 ERR_R_MALLOC_FAILURE);
433 return(NULL); 433 return(NULL);
434 } 434 }
435 BUF_strlcpy(result, filename, strlen(filename) + 1); 435 strlcpy(result, filename, strlen(filename) + 1);
436 } 436 }
437 return(result); 437 return(result);
438 } 438 }
diff --git a/src/lib/libcrypto/err/err.c b/src/lib/libcrypto/err/err.c
index 27a19bc52c..0672477cc8 100644
--- a/src/lib/libcrypto/err/err.c
+++ b/src/lib/libcrypto/err/err.c
@@ -1071,7 +1071,7 @@ void ERR_add_error_vdata(int num, va_list args)
1071 else 1071 else
1072 str=p; 1072 str=p;
1073 } 1073 }
1074 BUF_strlcat(str,a,(size_t)s+1); 1074 strlcat(str,a,(size_t)s+1);
1075 } 1075 }
1076 } 1076 }
1077 ERR_set_error_data(str,ERR_TXT_MALLOCED|ERR_TXT_STRING); 1077 ERR_set_error_data(str,ERR_TXT_MALLOCED|ERR_TXT_STRING);
diff --git a/src/lib/libcrypto/evp/evp_pbe.c b/src/lib/libcrypto/evp/evp_pbe.c
index c808b96fef..37a926c3fc 100644
--- a/src/lib/libcrypto/evp/evp_pbe.c
+++ b/src/lib/libcrypto/evp/evp_pbe.c
@@ -165,7 +165,7 @@ int EVP_PBE_CipherInit(ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
165 { 165 {
166 char obj_tmp[80]; 166 char obj_tmp[80];
167 EVPerr(EVP_F_EVP_PBE_CIPHERINIT,EVP_R_UNKNOWN_PBE_ALGORITHM); 167 EVPerr(EVP_F_EVP_PBE_CIPHERINIT,EVP_R_UNKNOWN_PBE_ALGORITHM);
168 if (!pbe_obj) BUF_strlcpy (obj_tmp, "NULL", sizeof obj_tmp); 168 if (!pbe_obj) strlcpy (obj_tmp, "NULL", sizeof obj_tmp);
169 else i2t_ASN1_OBJECT(obj_tmp, sizeof obj_tmp, pbe_obj); 169 else i2t_ASN1_OBJECT(obj_tmp, sizeof obj_tmp, pbe_obj);
170 ERR_add_error_data(2, "TYPE=", obj_tmp); 170 ERR_add_error_data(2, "TYPE=", obj_tmp);
171 return 0; 171 return 0;
diff --git a/src/lib/libcrypto/objects/obj_dat.c b/src/lib/libcrypto/objects/obj_dat.c
index cf4db7c6b5..b3388b117d 100644
--- a/src/lib/libcrypto/objects/obj_dat.c
+++ b/src/lib/libcrypto/objects/obj_dat.c
@@ -486,7 +486,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
486 if (s) 486 if (s)
487 { 487 {
488 if (buf) 488 if (buf)
489 BUF_strlcpy(buf,s,buf_len); 489 strlcpy(buf,s,buf_len);
490 n=strlen(s); 490 n=strlen(s);
491 return n; 491 return n;
492 } 492 }
@@ -576,7 +576,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
576 *buf++ = '.'; 576 *buf++ = '.';
577 buf_len--; 577 buf_len--;
578 } 578 }
579 BUF_strlcpy(buf,bndec,buf_len); 579 strlcpy(buf,bndec,buf_len);
580 if (i > buf_len) 580 if (i > buf_len)
581 { 581 {
582 buf += buf_len; 582 buf += buf_len;
@@ -598,7 +598,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
598 i=strlen(tbuf); 598 i=strlen(tbuf);
599 if (buf && (buf_len > 0)) 599 if (buf && (buf_len > 0))
600 { 600 {
601 BUF_strlcpy(buf,tbuf,buf_len); 601 strlcpy(buf,tbuf,buf_len);
602 if (i > buf_len) 602 if (i > buf_len)
603 { 603 {
604 buf += buf_len; 604 buf += buf_len;
diff --git a/src/lib/libcrypto/pem/pem_lib.c b/src/lib/libcrypto/pem/pem_lib.c
index aa6a4c9387..93736455fa 100644
--- a/src/lib/libcrypto/pem/pem_lib.c
+++ b/src/lib/libcrypto/pem/pem_lib.c
@@ -137,9 +137,9 @@ void PEM_proc_type(char *buf, int type)
137 else 137 else
138 str="BAD-TYPE"; 138 str="BAD-TYPE";
139 139
140 BUF_strlcat(buf,"Proc-Type: 4,",PEM_BUFSIZE); 140 strlcat(buf,"Proc-Type: 4,",PEM_BUFSIZE);
141 BUF_strlcat(buf,str,PEM_BUFSIZE); 141 strlcat(buf,str,PEM_BUFSIZE);
142 BUF_strlcat(buf,"\n",PEM_BUFSIZE); 142 strlcat(buf,"\n",PEM_BUFSIZE);
143 } 143 }
144 144
145void PEM_dek_info(char *buf, const char *type, int len, char *str) 145void PEM_dek_info(char *buf, const char *type, int len, char *str)
@@ -148,9 +148,9 @@ void PEM_dek_info(char *buf, const char *type, int len, char *str)
148 long i; 148 long i;
149 int j; 149 int j;
150 150
151 BUF_strlcat(buf,"DEK-Info: ",PEM_BUFSIZE); 151 strlcat(buf,"DEK-Info: ",PEM_BUFSIZE);
152 BUF_strlcat(buf,type,PEM_BUFSIZE); 152 strlcat(buf,type,PEM_BUFSIZE);
153 BUF_strlcat(buf,",",PEM_BUFSIZE); 153 strlcat(buf,",",PEM_BUFSIZE);
154 j=strlen(buf); 154 j=strlen(buf);
155 if (j + (len * 2) + 1 > PEM_BUFSIZE) 155 if (j + (len * 2) + 1 > PEM_BUFSIZE)
156 return; 156 return;
diff --git a/src/lib/libcrypto/rand/randfile.c b/src/lib/libcrypto/rand/randfile.c
index 2525804668..5326f710c5 100644
--- a/src/lib/libcrypto/rand/randfile.c
+++ b/src/lib/libcrypto/rand/randfile.c
@@ -142,7 +142,7 @@ err:
142 142
143const char *RAND_file_name(char *buf, size_t size) 143const char *RAND_file_name(char *buf, size_t size)
144{ 144{
145 if (BUF_strlcpy(buf,"/dev/urandom",size) >= size) 145 if (strlcpy(buf,"/dev/urandom",size) >= size)
146 return(NULL); 146 return(NULL);
147 return buf; 147 return buf;
148} 148}
diff --git a/src/lib/libcrypto/ui/ui_lib.c b/src/lib/libcrypto/ui/ui_lib.c
index fc03d9b7d4..58e4c5d722 100644
--- a/src/lib/libcrypto/ui/ui_lib.c
+++ b/src/lib/libcrypto/ui/ui_lib.c
@@ -409,13 +409,13 @@ UI_construct_prompt(UI *ui, const char *object_desc, const char *object_name)
409 len += sizeof(prompt3) - 1; 409 len += sizeof(prompt3) - 1;
410 410
411 prompt = (char *)malloc(len + 1); 411 prompt = (char *)malloc(len + 1);
412 BUF_strlcpy(prompt, prompt1, len + 1); 412 strlcpy(prompt, prompt1, len + 1);
413 BUF_strlcat(prompt, object_desc, len + 1); 413 strlcat(prompt, object_desc, len + 1);
414 if (object_name) { 414 if (object_name) {
415 BUF_strlcat(prompt, prompt2, len + 1); 415 strlcat(prompt, prompt2, len + 1);
416 BUF_strlcat(prompt, object_name, len + 1); 416 strlcat(prompt, object_name, len + 1);
417 } 417 }
418 BUF_strlcat(prompt, prompt3, len + 1); 418 strlcat(prompt, prompt3, len + 1);
419 } 419 }
420 return prompt; 420 return prompt;
421} 421}
@@ -869,7 +869,7 @@ UI_set_result(UI *ui, UI_STRING *uis, const char *result)
869 UIerr(UI_F_UI_SET_RESULT, UI_R_NO_RESULT_BUFFER); 869 UIerr(UI_F_UI_SET_RESULT, UI_R_NO_RESULT_BUFFER);
870 return -1; 870 return -1;
871 } 871 }
872 BUF_strlcpy(uis->result_buf, result, 872 strlcpy(uis->result_buf, result,
873 uis->_.string_data.result_maxsize + 1); 873 uis->_.string_data.result_maxsize + 1);
874 break; 874 break;
875 case UIT_BOOLEAN: 875 case UIT_BOOLEAN:
diff --git a/src/lib/libcrypto/x509v3/v3_info.c b/src/lib/libcrypto/x509v3/v3_info.c
index 2b290ca00c..c9d6c97b51 100644
--- a/src/lib/libcrypto/x509v3/v3_info.c
+++ b/src/lib/libcrypto/x509v3/v3_info.c
@@ -121,9 +121,9 @@ static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD *method
121 ERR_R_MALLOC_FAILURE); 121 ERR_R_MALLOC_FAILURE);
122 return NULL; 122 return NULL;
123 } 123 }
124 BUF_strlcpy(ntmp, objtmp, nlen); 124 strlcpy(ntmp, objtmp, nlen);
125 BUF_strlcat(ntmp, " - ", nlen); 125 strlcat(ntmp, " - ", nlen);
126 BUF_strlcat(ntmp, vtmp->name, nlen); 126 strlcat(ntmp, vtmp->name, nlen);
127 free(vtmp->name); 127 free(vtmp->name);
128 vtmp->name = ntmp; 128 vtmp->name = ntmp;
129 129
diff --git a/src/lib/libssl/src/apps/apps.c b/src/lib/libssl/src/apps/apps.c
index 446bb4d17c..4a8be9993d 100644
--- a/src/lib/libssl/src/apps/apps.c
+++ b/src/lib/libssl/src/apps/apps.c
@@ -198,7 +198,7 @@ program_name(char *in, char *out, int size)
198 p++; 198 p++;
199 else 199 else
200 p = in; 200 p = in;
201 BUF_strlcpy(out, p, size); 201 strlcpy(out, p, size);
202} 202}
203 203
204int 204int
@@ -1447,7 +1447,7 @@ save_serial(char *serialfile, char *suffix, BIGNUM * serial,
1447 goto err; 1447 goto err;
1448 } 1448 }
1449 if (suffix == NULL) 1449 if (suffix == NULL)
1450 BUF_strlcpy(buf[0], serialfile, BSIZE); 1450 strlcpy(buf[0], serialfile, BSIZE);
1451 else 1451 else
1452 (void) snprintf(buf[0], sizeof buf[0], "%s.%s", serialfile, suffix); 1452 (void) snprintf(buf[0], sizeof buf[0], "%s.%s", serialfile, suffix);
1453#ifdef RL_DEBUG 1453#ifdef RL_DEBUG
diff --git a/src/lib/libssl/src/apps/ca.c b/src/lib/libssl/src/apps/ca.c
index c582549b15..3f2d10671c 100644
--- a/src/lib/libssl/src/apps/ca.c
+++ b/src/lib/libssl/src/apps/ca.c
@@ -1136,7 +1136,7 @@ ca_main(int argc, char **argv)
1136 } 1136 }
1137 strlcpy(buf[2], outdir, sizeof(buf[2])); 1137 strlcpy(buf[2], outdir, sizeof(buf[2]));
1138 1138
1139 BUF_strlcat(buf[2], "/", sizeof(buf[2])); 1139 strlcat(buf[2], "/", sizeof(buf[2]));
1140 1140
1141 n = (char *) &(buf[2][strlen(buf[2])]); 1141 n = (char *) &(buf[2][strlen(buf[2])]);
1142 if (j > 0) { 1142 if (j > 0) {
@@ -1955,7 +1955,7 @@ do_body(X509 ** xret, EVP_PKEY * pkey, X509 * x509, const EVP_MD * dgst,
1955 BIO_printf(bio_err, "Memory allocation failure\n"); 1955 BIO_printf(bio_err, "Memory allocation failure\n");
1956 goto err; 1956 goto err;
1957 } 1957 }
1958 BUF_strlcpy(row[DB_file], "unknown", 8); 1958 strlcpy(row[DB_file], "unknown", 8);
1959 row[DB_type][0] = 'V'; 1959 row[DB_type][0] = 'V';
1960 row[DB_type][1] = '\0'; 1960 row[DB_type][1] = '\0';
1961 1961
@@ -2211,7 +2211,7 @@ do_revoke(X509 * x509, CA_DB * db, int type, char *value)
2211 BIO_printf(bio_err, "Memory allocation failure\n"); 2211 BIO_printf(bio_err, "Memory allocation failure\n");
2212 goto err; 2212 goto err;
2213 } 2213 }
2214 BUF_strlcpy(row[DB_file], "unknown", 8); 2214 strlcpy(row[DB_file], "unknown", 8);
2215 row[DB_type][0] = 'V'; 2215 row[DB_type][0] = 'V';
2216 row[DB_type][1] = '\0'; 2216 row[DB_type][1] = '\0';
2217 2217
@@ -2497,14 +2497,14 @@ make_revocation_str(int rev_type, char *rev_arg)
2497 if (!str) 2497 if (!str)
2498 return NULL; 2498 return NULL;
2499 2499
2500 BUF_strlcpy(str, (char *) revtm->data, i); 2500 strlcpy(str, (char *) revtm->data, i);
2501 if (reason) { 2501 if (reason) {
2502 BUF_strlcat(str, ",", i); 2502 strlcat(str, ",", i);
2503 BUF_strlcat(str, reason, i); 2503 strlcat(str, reason, i);
2504 } 2504 }
2505 if (other) { 2505 if (other) {
2506 BUF_strlcat(str, ",", i); 2506 strlcat(str, ",", i);
2507 BUF_strlcat(str, other, i); 2507 strlcat(str, other, i);
2508 } 2508 }
2509 ASN1_UTCTIME_free(revtm); 2509 ASN1_UTCTIME_free(revtm);
2510 return str; 2510 return str;
diff --git a/src/lib/libssl/src/apps/engine.c b/src/lib/libssl/src/apps/engine.c
index 5ed33d0d39..7898c96f23 100644
--- a/src/lib/libssl/src/apps/engine.c
+++ b/src/lib/libssl/src/apps/engine.c
@@ -119,8 +119,8 @@ append_buf(char **buf, const char *s, int *size, int step)
119 return 0; 119 return 0;
120 120
121 if (**buf != '\0') 121 if (**buf != '\0')
122 BUF_strlcat(*buf, ", ", *size); 122 strlcat(*buf, ", ", *size);
123 BUF_strlcat(*buf, s, *size); 123 strlcat(*buf, s, *size);
124 124
125 return 1; 125 return 1;
126} 126}
diff --git a/src/lib/libssl/src/apps/pkcs12.c b/src/lib/libssl/src/apps/pkcs12.c
index 933fded99a..44ee698605 100644
--- a/src/lib/libssl/src/apps/pkcs12.c
+++ b/src/lib/libssl/src/apps/pkcs12.c
@@ -592,7 +592,7 @@ pkcs12_main(int argc, char **argv)
592 goto export_end; 592 goto export_end;
593 } 593 }
594 if (!twopass) 594 if (!twopass)
595 BUF_strlcpy(macpass, pass, sizeof macpass); 595 strlcpy(macpass, pass, sizeof macpass);
596 596
597#ifdef CRYPTO_MDEBUG 597#ifdef CRYPTO_MDEBUG
598 CRYPTO_pop_info(); 598 CRYPTO_pop_info();
@@ -661,7 +661,7 @@ export_end:
661#endif 661#endif
662 662
663 if (!twopass) 663 if (!twopass)
664 BUF_strlcpy(macpass, pass, sizeof macpass); 664 strlcpy(macpass, pass, sizeof macpass);
665 665
666 if ((options & INFO) && p12->mac) 666 if ((options & INFO) && p12->mac)
667 BIO_printf(bio_err, "MAC Iteration %ld\n", p12->mac->iter ? ASN1_INTEGER_get(p12->mac->iter) : 1); 667 BIO_printf(bio_err, "MAC Iteration %ld\n", p12->mac->iter ? ASN1_INTEGER_get(p12->mac->iter) : 1);
diff --git a/src/lib/libssl/src/apps/req.c b/src/lib/libssl/src/apps/req.c
index 6f46e82ecd..1ed8c84a8d 100644
--- a/src/lib/libssl/src/apps/req.c
+++ b/src/lib/libssl/src/apps/req.c
@@ -1227,8 +1227,8 @@ start:
1227 BIO_printf(bio_err, "%s [%s]:", text, def); 1227 BIO_printf(bio_err, "%s [%s]:", text, def);
1228 (void) BIO_flush(bio_err); 1228 (void) BIO_flush(bio_err);
1229 if (value != NULL) { 1229 if (value != NULL) {
1230 BUF_strlcpy(buf, value, sizeof buf); 1230 strlcpy(buf, value, sizeof buf);
1231 BUF_strlcat(buf, "\n", sizeof buf); 1231 strlcat(buf, "\n", sizeof buf);
1232 BIO_printf(bio_err, "%s\n", value); 1232 BIO_printf(bio_err, "%s\n", value);
1233 } else { 1233 } else {
1234 buf[0] = '\0'; 1234 buf[0] = '\0';
@@ -1246,8 +1246,8 @@ start:
1246 else if (buf[0] == '\n') { 1246 else if (buf[0] == '\n') {
1247 if ((def == NULL) || (def[0] == '\0')) 1247 if ((def == NULL) || (def[0] == '\0'))
1248 return (1); 1248 return (1);
1249 BUF_strlcpy(buf, def, sizeof buf); 1249 strlcpy(buf, def, sizeof buf);
1250 BUF_strlcat(buf, "\n", sizeof buf); 1250 strlcat(buf, "\n", sizeof buf);
1251 } else if ((buf[0] == '.') && (buf[1] == '\n')) 1251 } else if ((buf[0] == '.') && (buf[1] == '\n'))
1252 return (1); 1252 return (1);
1253 1253
@@ -1280,8 +1280,8 @@ start:
1280 BIO_printf(bio_err, "%s [%s]:", text, def); 1280 BIO_printf(bio_err, "%s [%s]:", text, def);
1281 (void) BIO_flush(bio_err); 1281 (void) BIO_flush(bio_err);
1282 if (value != NULL) { 1282 if (value != NULL) {
1283 BUF_strlcpy(buf, value, sizeof buf); 1283 strlcpy(buf, value, sizeof buf);
1284 BUF_strlcat(buf, "\n", sizeof buf); 1284 strlcat(buf, "\n", sizeof buf);
1285 BIO_printf(bio_err, "%s\n", value); 1285 BIO_printf(bio_err, "%s\n", value);
1286 } else { 1286 } else {
1287 buf[0] = '\0'; 1287 buf[0] = '\0';
@@ -1299,8 +1299,8 @@ start:
1299 else if (buf[0] == '\n') { 1299 else if (buf[0] == '\n') {
1300 if ((def == NULL) || (def[0] == '\0')) 1300 if ((def == NULL) || (def[0] == '\0'))
1301 return (1); 1301 return (1);
1302 BUF_strlcpy(buf, def, sizeof buf); 1302 strlcpy(buf, def, sizeof buf);
1303 BUF_strlcat(buf, "\n", sizeof buf); 1303 strlcat(buf, "\n", sizeof buf);
1304 } else if ((buf[0] == '.') && (buf[1] == '\n')) 1304 } else if ((buf[0] == '.') && (buf[1] == '\n'))
1305 return (1); 1305 return (1);
1306 1306
diff --git a/src/lib/libssl/src/apps/s_socket.c b/src/lib/libssl/src/apps/s_socket.c
index b801cf7796..57015ed8ff 100644
--- a/src/lib/libssl/src/apps/s_socket.c
+++ b/src/lib/libssl/src/apps/s_socket.c
@@ -306,7 +306,7 @@ redoit:
306 perror("malloc"); 306 perror("malloc");
307 return (0); 307 return (0);
308 } 308 }
309 BUF_strlcpy(*host, h1->h_name, strlen(h1->h_name) + 1); 309 strlcpy(*host, h1->h_name, strlen(h1->h_name) + 1);
310 310
311 h2 = GetHostByName(*host); 311 h2 = GetHostByName(*host);
312 if (h2 == NULL) { 312 if (h2 == NULL) {
diff --git a/src/lib/libssl/src/apps/x509.c b/src/lib/libssl/src/apps/x509.c
index 5841a1b80d..18b9e71586 100644
--- a/src/lib/libssl/src/apps/x509.c
+++ b/src/lib/libssl/src/apps/x509.c
@@ -971,15 +971,15 @@ x509_load_serial(char *CAfile, char *serialfile, int create)
971 goto end; 971 goto end;
972 } 972 }
973 if (serialfile == NULL) { 973 if (serialfile == NULL) {
974 BUF_strlcpy(buf, CAfile, len); 974 strlcpy(buf, CAfile, len);
975 for (p = buf; *p; p++) 975 for (p = buf; *p; p++)
976 if (*p == '.') { 976 if (*p == '.') {
977 *p = '\0'; 977 *p = '\0';
978 break; 978 break;
979 } 979 }
980 BUF_strlcat(buf, POSTFIX, len); 980 strlcat(buf, POSTFIX, len);
981 } else 981 } else
982 BUF_strlcpy(buf, serialfile, len); 982 strlcpy(buf, serialfile, len);
983 983
984 serial = load_serial(buf, create, NULL); 984 serial = load_serial(buf, create, NULL);
985 if (serial == NULL) 985 if (serial == NULL)
diff --git a/src/lib/libssl/src/crypto/asn1/a_time.c b/src/lib/libssl/src/crypto/asn1/a_time.c
index f3f28369f4..1978e8d3dc 100644
--- a/src/lib/libssl/src/crypto/asn1/a_time.c
+++ b/src/lib/libssl/src/crypto/asn1/a_time.c
@@ -147,10 +147,10 @@ ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZE
147 newlen = t->length + 2 + 1; 147 newlen = t->length + 2 + 1;
148 str = (char *)ret->data; 148 str = (char *)ret->data;
149 /* Work out the century and prepend */ 149 /* Work out the century and prepend */
150 if (t->data[0] >= '5') BUF_strlcpy(str, "19", newlen); 150 if (t->data[0] >= '5') strlcpy(str, "19", newlen);
151 else BUF_strlcpy(str, "20", newlen); 151 else strlcpy(str, "20", newlen);
152 152
153 BUF_strlcat(str, (char *)t->data, newlen); 153 strlcat(str, (char *)t->data, newlen);
154 154
155 return ret; 155 return ret;
156} 156}
diff --git a/src/lib/libssl/src/crypto/bio/b_dump.c b/src/lib/libssl/src/crypto/bio/b_dump.c
index ff75069df8..61c9fe20a3 100644
--- a/src/lib/libssl/src/crypto/bio/b_dump.c
+++ b/src/lib/libssl/src/crypto/bio/b_dump.c
@@ -107,29 +107,29 @@ BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u),
107 rows++; 107 rows++;
108 for (i = 0; i < rows; i++) { 108 for (i = 0; i < rows; i++) {
109 buf[0] = '\0'; /* start with empty string */ 109 buf[0] = '\0'; /* start with empty string */
110 BUF_strlcpy(buf, str, sizeof buf); 110 strlcpy(buf, str, sizeof buf);
111 (void) snprintf(tmp, sizeof tmp, "%04x - ", i*dump_width); 111 (void) snprintf(tmp, sizeof tmp, "%04x - ", i*dump_width);
112 BUF_strlcat(buf, tmp, sizeof buf); 112 strlcat(buf, tmp, sizeof buf);
113 for (j = 0; j < dump_width; j++) { 113 for (j = 0; j < dump_width; j++) {
114 if (((i*dump_width) + j) >= len) { 114 if (((i*dump_width) + j) >= len) {
115 BUF_strlcat(buf, " ", sizeof buf); 115 strlcat(buf, " ", sizeof buf);
116 } else { 116 } else {
117 ch = ((unsigned char)*(s + i*dump_width + j)) & 0xff; 117 ch = ((unsigned char)*(s + i*dump_width + j)) & 0xff;
118 (void) snprintf(tmp, sizeof tmp, "%02x%c", ch, 118 (void) snprintf(tmp, sizeof tmp, "%02x%c", ch,
119 j == 7 ? '-' : ' '); 119 j == 7 ? '-' : ' ');
120 BUF_strlcat(buf, tmp, sizeof buf); 120 strlcat(buf, tmp, sizeof buf);
121 } 121 }
122 } 122 }
123 BUF_strlcat(buf, " ", sizeof buf); 123 strlcat(buf, " ", sizeof buf);
124 for (j = 0; j < dump_width; j++) { 124 for (j = 0; j < dump_width; j++) {
125 if (((i*dump_width) + j) >= len) 125 if (((i*dump_width) + j) >= len)
126 break; 126 break;
127 ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff; 127 ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff;
128 (void) snprintf(tmp, sizeof tmp, "%c", 128 (void) snprintf(tmp, sizeof tmp, "%c",
129 ((ch >= ' ') && (ch <= '~')) ? ch : '.'); 129 ((ch >= ' ') && (ch <= '~')) ? ch : '.');
130 BUF_strlcat(buf, tmp, sizeof buf); 130 strlcat(buf, tmp, sizeof buf);
131 } 131 }
132 BUF_strlcat(buf, "\n", sizeof buf); 132 strlcat(buf, "\n", sizeof buf);
133 /* if this is the last call then update the ddt_dump thing so 133 /* if this is the last call then update the ddt_dump thing so
134 * that we will move the selection point in the debug window 134 * that we will move the selection point in the debug window
135 */ 135 */
diff --git a/src/lib/libssl/src/crypto/bio/bss_file.c b/src/lib/libssl/src/crypto/bio/bss_file.c
index 995c623341..acc746260e 100644
--- a/src/lib/libssl/src/crypto/bio/bss_file.c
+++ b/src/lib/libssl/src/crypto/bio/bss_file.c
@@ -246,14 +246,14 @@ file_ctrl(BIO *b, int cmd, long num, void *ptr)
246 b->shutdown = (int)num&BIO_CLOSE; 246 b->shutdown = (int)num&BIO_CLOSE;
247 if (num & BIO_FP_APPEND) { 247 if (num & BIO_FP_APPEND) {
248 if (num & BIO_FP_READ) 248 if (num & BIO_FP_READ)
249 BUF_strlcpy(p, "a+", sizeof p); 249 strlcpy(p, "a+", sizeof p);
250 else BUF_strlcpy(p, "a", sizeof p); 250 else strlcpy(p, "a", sizeof p);
251 } else if ((num & BIO_FP_READ) && (num & BIO_FP_WRITE)) 251 } else if ((num & BIO_FP_READ) && (num & BIO_FP_WRITE))
252 BUF_strlcpy(p, "r+", sizeof p); 252 strlcpy(p, "r+", sizeof p);
253 else if (num & BIO_FP_WRITE) 253 else if (num & BIO_FP_WRITE)
254 BUF_strlcpy(p, "w", sizeof p); 254 strlcpy(p, "w", sizeof p);
255 else if (num & BIO_FP_READ) 255 else if (num & BIO_FP_READ)
256 BUF_strlcpy(p, "r", sizeof p); 256 strlcpy(p, "r", sizeof p);
257 else { 257 else {
258 BIOerr(BIO_F_FILE_CTRL, BIO_R_BAD_FOPEN_MODE); 258 BIOerr(BIO_F_FILE_CTRL, BIO_R_BAD_FOPEN_MODE);
259 ret = 0; 259 ret = 0;
diff --git a/src/lib/libssl/src/crypto/conf/conf_def.c b/src/lib/libssl/src/crypto/conf/conf_def.c
index 39e8b8e521..26aee50a45 100644
--- a/src/lib/libssl/src/crypto/conf/conf_def.c
+++ b/src/lib/libssl/src/crypto/conf/conf_def.c
@@ -230,7 +230,7 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
230 CONFerr(CONF_F_DEF_LOAD_BIO,ERR_R_MALLOC_FAILURE); 230 CONFerr(CONF_F_DEF_LOAD_BIO,ERR_R_MALLOC_FAILURE);
231 goto err; 231 goto err;
232 } 232 }
233 BUF_strlcpy(section,"default",10); 233 strlcpy(section,"default",10);
234 234
235 if (_CONF_new_data(conf) == 0) 235 if (_CONF_new_data(conf) == 0)
236 { 236 {
@@ -384,7 +384,7 @@ again:
384 ERR_R_MALLOC_FAILURE); 384 ERR_R_MALLOC_FAILURE);
385 goto err; 385 goto err;
386 } 386 }
387 BUF_strlcpy(v->name,pname,strlen(pname)+1); 387 strlcpy(v->name,pname,strlen(pname)+1);
388 if (!str_copy(conf,psection,&(v->value),start)) goto err; 388 if (!str_copy(conf,psection,&(v->value),start)) goto err;
389 389
390 if (strcmp(psection,section) != 0) 390 if (strcmp(psection,section) != 0)
diff --git a/src/lib/libssl/src/crypto/dso/dso_lib.c b/src/lib/libssl/src/crypto/dso/dso_lib.c
index 00e65938b9..2f77242d47 100644
--- a/src/lib/libssl/src/crypto/dso/dso_lib.c
+++ b/src/lib/libssl/src/crypto/dso/dso_lib.c
@@ -373,7 +373,7 @@ int DSO_set_filename(DSO *dso, const char *filename)
373 DSOerr(DSO_F_DSO_SET_FILENAME,ERR_R_MALLOC_FAILURE); 373 DSOerr(DSO_F_DSO_SET_FILENAME,ERR_R_MALLOC_FAILURE);
374 return(0); 374 return(0);
375 } 375 }
376 BUF_strlcpy(copied, filename, strlen(filename) + 1); 376 strlcpy(copied, filename, strlen(filename) + 1);
377 if(dso->filename) 377 if(dso->filename)
378 free(dso->filename); 378 free(dso->filename);
379 dso->filename = copied; 379 dso->filename = copied;
@@ -432,7 +432,7 @@ char *DSO_convert_filename(DSO *dso, const char *filename)
432 ERR_R_MALLOC_FAILURE); 432 ERR_R_MALLOC_FAILURE);
433 return(NULL); 433 return(NULL);
434 } 434 }
435 BUF_strlcpy(result, filename, strlen(filename) + 1); 435 strlcpy(result, filename, strlen(filename) + 1);
436 } 436 }
437 return(result); 437 return(result);
438 } 438 }
diff --git a/src/lib/libssl/src/crypto/err/err.c b/src/lib/libssl/src/crypto/err/err.c
index 27a19bc52c..0672477cc8 100644
--- a/src/lib/libssl/src/crypto/err/err.c
+++ b/src/lib/libssl/src/crypto/err/err.c
@@ -1071,7 +1071,7 @@ void ERR_add_error_vdata(int num, va_list args)
1071 else 1071 else
1072 str=p; 1072 str=p;
1073 } 1073 }
1074 BUF_strlcat(str,a,(size_t)s+1); 1074 strlcat(str,a,(size_t)s+1);
1075 } 1075 }
1076 } 1076 }
1077 ERR_set_error_data(str,ERR_TXT_MALLOCED|ERR_TXT_STRING); 1077 ERR_set_error_data(str,ERR_TXT_MALLOCED|ERR_TXT_STRING);
diff --git a/src/lib/libssl/src/crypto/evp/evp_pbe.c b/src/lib/libssl/src/crypto/evp/evp_pbe.c
index c808b96fef..37a926c3fc 100644
--- a/src/lib/libssl/src/crypto/evp/evp_pbe.c
+++ b/src/lib/libssl/src/crypto/evp/evp_pbe.c
@@ -165,7 +165,7 @@ int EVP_PBE_CipherInit(ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
165 { 165 {
166 char obj_tmp[80]; 166 char obj_tmp[80];
167 EVPerr(EVP_F_EVP_PBE_CIPHERINIT,EVP_R_UNKNOWN_PBE_ALGORITHM); 167 EVPerr(EVP_F_EVP_PBE_CIPHERINIT,EVP_R_UNKNOWN_PBE_ALGORITHM);
168 if (!pbe_obj) BUF_strlcpy (obj_tmp, "NULL", sizeof obj_tmp); 168 if (!pbe_obj) strlcpy (obj_tmp, "NULL", sizeof obj_tmp);
169 else i2t_ASN1_OBJECT(obj_tmp, sizeof obj_tmp, pbe_obj); 169 else i2t_ASN1_OBJECT(obj_tmp, sizeof obj_tmp, pbe_obj);
170 ERR_add_error_data(2, "TYPE=", obj_tmp); 170 ERR_add_error_data(2, "TYPE=", obj_tmp);
171 return 0; 171 return 0;
diff --git a/src/lib/libssl/src/crypto/objects/obj_dat.c b/src/lib/libssl/src/crypto/objects/obj_dat.c
index cf4db7c6b5..b3388b117d 100644
--- a/src/lib/libssl/src/crypto/objects/obj_dat.c
+++ b/src/lib/libssl/src/crypto/objects/obj_dat.c
@@ -486,7 +486,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
486 if (s) 486 if (s)
487 { 487 {
488 if (buf) 488 if (buf)
489 BUF_strlcpy(buf,s,buf_len); 489 strlcpy(buf,s,buf_len);
490 n=strlen(s); 490 n=strlen(s);
491 return n; 491 return n;
492 } 492 }
@@ -576,7 +576,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
576 *buf++ = '.'; 576 *buf++ = '.';
577 buf_len--; 577 buf_len--;
578 } 578 }
579 BUF_strlcpy(buf,bndec,buf_len); 579 strlcpy(buf,bndec,buf_len);
580 if (i > buf_len) 580 if (i > buf_len)
581 { 581 {
582 buf += buf_len; 582 buf += buf_len;
@@ -598,7 +598,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
598 i=strlen(tbuf); 598 i=strlen(tbuf);
599 if (buf && (buf_len > 0)) 599 if (buf && (buf_len > 0))
600 { 600 {
601 BUF_strlcpy(buf,tbuf,buf_len); 601 strlcpy(buf,tbuf,buf_len);
602 if (i > buf_len) 602 if (i > buf_len)
603 { 603 {
604 buf += buf_len; 604 buf += buf_len;
diff --git a/src/lib/libssl/src/crypto/pem/pem_lib.c b/src/lib/libssl/src/crypto/pem/pem_lib.c
index aa6a4c9387..93736455fa 100644
--- a/src/lib/libssl/src/crypto/pem/pem_lib.c
+++ b/src/lib/libssl/src/crypto/pem/pem_lib.c
@@ -137,9 +137,9 @@ void PEM_proc_type(char *buf, int type)
137 else 137 else
138 str="BAD-TYPE"; 138 str="BAD-TYPE";
139 139
140 BUF_strlcat(buf,"Proc-Type: 4,",PEM_BUFSIZE); 140 strlcat(buf,"Proc-Type: 4,",PEM_BUFSIZE);
141 BUF_strlcat(buf,str,PEM_BUFSIZE); 141 strlcat(buf,str,PEM_BUFSIZE);
142 BUF_strlcat(buf,"\n",PEM_BUFSIZE); 142 strlcat(buf,"\n",PEM_BUFSIZE);
143 } 143 }
144 144
145void PEM_dek_info(char *buf, const char *type, int len, char *str) 145void PEM_dek_info(char *buf, const char *type, int len, char *str)
@@ -148,9 +148,9 @@ void PEM_dek_info(char *buf, const char *type, int len, char *str)
148 long i; 148 long i;
149 int j; 149 int j;
150 150
151 BUF_strlcat(buf,"DEK-Info: ",PEM_BUFSIZE); 151 strlcat(buf,"DEK-Info: ",PEM_BUFSIZE);
152 BUF_strlcat(buf,type,PEM_BUFSIZE); 152 strlcat(buf,type,PEM_BUFSIZE);
153 BUF_strlcat(buf,",",PEM_BUFSIZE); 153 strlcat(buf,",",PEM_BUFSIZE);
154 j=strlen(buf); 154 j=strlen(buf);
155 if (j + (len * 2) + 1 > PEM_BUFSIZE) 155 if (j + (len * 2) + 1 > PEM_BUFSIZE)
156 return; 156 return;
diff --git a/src/lib/libssl/src/crypto/rand/randfile.c b/src/lib/libssl/src/crypto/rand/randfile.c
index 2525804668..5326f710c5 100644
--- a/src/lib/libssl/src/crypto/rand/randfile.c
+++ b/src/lib/libssl/src/crypto/rand/randfile.c
@@ -142,7 +142,7 @@ err:
142 142
143const char *RAND_file_name(char *buf, size_t size) 143const char *RAND_file_name(char *buf, size_t size)
144{ 144{
145 if (BUF_strlcpy(buf,"/dev/urandom",size) >= size) 145 if (strlcpy(buf,"/dev/urandom",size) >= size)
146 return(NULL); 146 return(NULL);
147 return buf; 147 return buf;
148} 148}
diff --git a/src/lib/libssl/src/crypto/ui/ui_lib.c b/src/lib/libssl/src/crypto/ui/ui_lib.c
index fc03d9b7d4..58e4c5d722 100644
--- a/src/lib/libssl/src/crypto/ui/ui_lib.c
+++ b/src/lib/libssl/src/crypto/ui/ui_lib.c
@@ -409,13 +409,13 @@ UI_construct_prompt(UI *ui, const char *object_desc, const char *object_name)
409 len += sizeof(prompt3) - 1; 409 len += sizeof(prompt3) - 1;
410 410
411 prompt = (char *)malloc(len + 1); 411 prompt = (char *)malloc(len + 1);
412 BUF_strlcpy(prompt, prompt1, len + 1); 412 strlcpy(prompt, prompt1, len + 1);
413 BUF_strlcat(prompt, object_desc, len + 1); 413 strlcat(prompt, object_desc, len + 1);
414 if (object_name) { 414 if (object_name) {
415 BUF_strlcat(prompt, prompt2, len + 1); 415 strlcat(prompt, prompt2, len + 1);
416 BUF_strlcat(prompt, object_name, len + 1); 416 strlcat(prompt, object_name, len + 1);
417 } 417 }
418 BUF_strlcat(prompt, prompt3, len + 1); 418 strlcat(prompt, prompt3, len + 1);
419 } 419 }
420 return prompt; 420 return prompt;
421} 421}
@@ -869,7 +869,7 @@ UI_set_result(UI *ui, UI_STRING *uis, const char *result)
869 UIerr(UI_F_UI_SET_RESULT, UI_R_NO_RESULT_BUFFER); 869 UIerr(UI_F_UI_SET_RESULT, UI_R_NO_RESULT_BUFFER);
870 return -1; 870 return -1;
871 } 871 }
872 BUF_strlcpy(uis->result_buf, result, 872 strlcpy(uis->result_buf, result,
873 uis->_.string_data.result_maxsize + 1); 873 uis->_.string_data.result_maxsize + 1);
874 break; 874 break;
875 case UIT_BOOLEAN: 875 case UIT_BOOLEAN:
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_info.c b/src/lib/libssl/src/crypto/x509v3/v3_info.c
index 2b290ca00c..c9d6c97b51 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_info.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_info.c
@@ -121,9 +121,9 @@ static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD *method
121 ERR_R_MALLOC_FAILURE); 121 ERR_R_MALLOC_FAILURE);
122 return NULL; 122 return NULL;
123 } 123 }
124 BUF_strlcpy(ntmp, objtmp, nlen); 124 strlcpy(ntmp, objtmp, nlen);
125 BUF_strlcat(ntmp, " - ", nlen); 125 strlcat(ntmp, " - ", nlen);
126 BUF_strlcat(ntmp, vtmp->name, nlen); 126 strlcat(ntmp, vtmp->name, nlen);
127 free(vtmp->name); 127 free(vtmp->name);
128 vtmp->name = ntmp; 128 vtmp->name = ntmp;
129 129