From a98c49d18e1785792d69127edcc69eb5d9cc13dd Mon Sep 17 00:00:00 2001 From: David Phillips Date: Wed, 16 May 2018 23:31:43 +1200 Subject: Correct strncpy bound --- sand-leek.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sand-leek.c') diff --git a/sand-leek.c b/sand-leek.c index 33d0556..8a745b8 100644 --- a/sand-leek.c +++ b/sand-leek.c @@ -35,7 +35,7 @@ static char no_ansi_esc = 0; static char *search; -static char search_pad[16]; +static char search_pad[17]; static unsigned char search_raw[10]; static size_t search_len; static int raw_len; @@ -425,7 +425,7 @@ main(int argc, char **argv) { return 1; } memset(search_pad, 0, sizeof(search_pad)); - strncpy(search_pad, search, sizeof(search_pad)); + strncpy(search_pad, search, sizeof(search_pad)-1); /* decode desired base32 */ onion_base32_dec(search_raw, search_pad); -- cgit v1.1