aboutsummaryrefslogtreecommitdiffstats
path: root/libar2_decode_params.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-02-16 20:23:12 +0100
committerMattias Andrée <maandree@kth.se>2022-02-16 20:23:12 +0100
commit35a9fff4df5571bdbdeeef71843b5b1671d34271 (patch)
tree37bcddf5a25c9df37a36468b09322fc155b76be5 /libar2_decode_params.c
parentAdd coverage test (diff)
downloadlibar2-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 'libar2_decode_params.c')
-rw-r--r--libar2_decode_params.c10
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);