aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2018-05-16 23:31:43 +1200
committerDavid Phillips <david@sighup.nz>2018-05-16 23:31:43 +1200
commita98c49d18e1785792d69127edcc69eb5d9cc13dd (patch)
tree79e0761efab2989d2a4f0231bb3bdd5d4ec70a78
parent0a65a875c7b8109cfd3fcab8fcd03f7c100dc1be (diff)
downloadsand-leek-a98c49d18e1785792d69127edcc69eb5d9cc13dd.tar.xz
Correct strncpy bound
-rw-r--r--sand-leek.c4
1 files changed, 2 insertions, 2 deletions
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);