aboutsummaryrefslogtreecommitdiffstats
path: root/update.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-07-07 11:37:52 +0200
committerMattias Andrée <maandree@kth.se>2022-07-07 11:37:52 +0200
commit6f96368d8620345a98e148436b96f4262ca73972 (patch)
tree7bff7bc8c08790a524e1d5a7446524e14bc0c255 /update.c
parentAdd coverage test (diff)
downloadlibsha1-6f96368d8620345a98e148436b96f4262ca73972.tar.gz
libsha1-6f96368d8620345a98e148436b96f4262ca73972.tar.bz2
libsha1-6f96368d8620345a98e148436b96f4262ca73972.tar.xz
Use malloc by default but allow bounded alloca
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'update.c')
-rw-r--r--update.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/update.c b/update.c
index 1725eb8..8799061 100644
--- a/update.c
+++ b/update.c
@@ -21,7 +21,7 @@ libsha1_update(struct libsha1_state *restrict state, const void *restrict messag
if (off) {
n = msglen < sizeof(state->chunk) - off ? msglen : sizeof(state->chunk) - off;
- memcpy(state->chunk + off, message, n);
+ memcpy(&state->chunk[off], message, n);
if (off + n == sizeof(state->chunk))
libsha1_process(state, state->chunk);
message += n;