diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/mem_dbg.c | 7 |
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 | ||
