diff options
author | Linus Nordberg <linus@nordu.net> | 2011-04-05 15:26:53 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2011-04-05 15:26:53 +0200 |
commit | 5042a29c4e80ca97fa51122954079d7d169037e9 (patch) | |
tree | d69ed5fea81811f226e4c8de5d4b25c3ef82e081 /fticks.c | |
parent | b23fcde92676758bb0447b1dad828fcacbbe0fd0 (diff) |
Don't smash buffer on stack.
(format_hash): Don't write past OUT_LEN. Duh!
Diffstat (limited to 'fticks.c')
-rw-r--r-- | fticks.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -21,7 +21,7 @@ format_hash(const uint8_t *hash, size_t out_len, uint8_t *out) { int i; - for (i = 0; i < out_len / 2; i++) + for (i = 0; i < out_len / 2 - 1; i++) sprintf((char *) out + i*2, "%02x", hash[i % SHA256_DIGEST_SIZE]); } |