diff options
author | Mattias Andrée <maandree@kth.se> | 2022-02-16 20:23:12 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2022-02-16 20:23:12 +0100 |
commit | 35a9fff4df5571bdbdeeef71843b5b1671d34271 (patch) | |
tree | 37bcddf5a25c9df37a36468b09322fc155b76be5 /libar2_decode_params.c | |
parent | Add coverage test (diff) | |
download | libar2-35a9fff4df5571bdbdeeef71843b5b1671d34271.tar.gz libar2-35a9fff4df5571bdbdeeef71843b5b1671d34271.tar.bz2 libar2-35a9fff4df5571bdbdeeef71843b5b1671d34271.tar.xz |
More tests and some small improvements
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | libar2_decode_params.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libar2_decode_params.c b/libar2_decode_params.c index fa59ab2..7707ce4 100644 --- a/libar2_decode_params.c +++ b/libar2_decode_params.c @@ -103,6 +103,8 @@ libar2_decode_params(const char *str, struct libar2_argon2_parameters *params, c if (*str != ',') goto einval; str++; + if (*str == '$') + goto einval; } if (have_t + have_m + have_p != 3) @@ -132,12 +134,12 @@ libar2_decode_params(const char *str, struct libar2_argon2_parameters *params, c return (size_t)(str - start); -einval: - errno = EINVAL; - goto fail; - erange: errno = ERANGE; + goto fail; + +einval: + errno = EINVAL; fail: if (*bufp) { ctx->deallocate(*bufp, ctx); |