summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/mem_dbg.c
diff options
context:
space:
mode:
authorho <>2003-03-16 12:18:21 +0000
committerho <>2003-03-16 12:18:21 +0000
commita4c0f9de9c618e0271a7e122136bdfe50301a6d7 (patch)
tree92679b9e140a2b594f7238dbaf4556cb2da66d73 /src/lib/libcrypto/mem_dbg.c
parent68d910a736124944b061ef4eb6d3e07b4682389a (diff)
downloadopenbsd-a4c0f9de9c618e0271a7e122136bdfe50301a6d7.tar.gz
openbsd-a4c0f9de9c618e0271a7e122136bdfe50301a6d7.tar.bz2
openbsd-a4c0f9de9c618e0271a7e122136bdfe50301a6d7.zip
Less strcpy/strcat/sprintf. tdeval@ ok.
Diffstat (limited to 'src/lib/libcrypto/mem_dbg.c')
-rw-r--r--src/lib/libcrypto/mem_dbg.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/libcrypto/mem_dbg.c b/src/lib/libcrypto/mem_dbg.c
index 1c4e04f51f..0beb3b36d1 100644
--- a/src/lib/libcrypto/mem_dbg.c
+++ b/src/lib/libcrypto/mem_dbg.c
@@ -629,7 +629,7 @@ static void print_leak(const MEM *m, MEM_LEAK *l)
629 629
630 ami_cnt++; 630 ami_cnt++;
631 memset(buf,'>',ami_cnt); 631 memset(buf,'>',ami_cnt);
632 sprintf(buf + ami_cnt, 632 snprintf(buf + ami_cnt, sizeof buf - ami_cnt,
633 " thread=%lu, file=%s, line=%d, info=\"", 633 " thread=%lu, file=%s, line=%d, info=\"",
634 amip->thread, amip->file, amip->line); 634 amip->thread, amip->file, amip->line);
635 buf_len=strlen(buf); 635 buf_len=strlen(buf);
@@ -641,10 +641,11 @@ static void print_leak(const MEM *m, MEM_LEAK *l)
641 } 641 }
642 else 642 else
643 { 643 {
644 strcpy(buf + buf_len, amip->info); 644 strlcpy(buf + buf_len, amip->info,
645 sizeof buf - buf_len);
645 buf_len = strlen(buf); 646 buf_len = strlen(buf);
646 } 647 }
647 sprintf(buf + buf_len, "\"\n"); 648 snprintf(buf + buf_len, sizeof buf - buf_len, "\"\n");
648 649
649 BIO_puts(l->bio,buf); 650 BIO_puts(l->bio,buf);
650 651