Avoid null SEGV if libargon passed string with too few $
Seen on netbsd-9 built xscreensaver running on a current system. Whatever triggered this should also be fixed, but in the meantime we can improve the behaviour from "Segmentation Fault"
This commit is contained in:
parent
c9667e8120
commit
04799ba54b
|
@ -335,13 +335,17 @@ decode_option(argon2_context *ctx, argon2_type *atype, const char *option)
|
|||
}
|
||||
|
||||
a = strsep(&inp, "$");
|
||||
if (a == null) {
|
||||
free(in);
|
||||
return -1;
|
||||
}
|
||||
|
||||
sl = ctx->saltlen;
|
||||
|
||||
if (from_base64(ctx->salt, &sl, a) == NULL) {
|
||||
free(in);
|
||||
free(in);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
ctx->saltlen = sl;
|
||||
|
||||
|
|
Loading…
Reference in New Issue