Fix NULL pointer dereference in jcmd_opt_set_jwkt()
Fix NULL pointer dereference in jcmd_opt_set_jwkt()

The jcmd_opt_set_jwkt() function calls json_loads() to decode the JSON
passed using the -i option. This function returns NULL on error and in
this case is attempted to first get the JSON from either the standard
input or a file.

But it's never checked again if one of those succeeded, so an invalid
JSON passed to jose jwk {gen,exc} leads to a NULL pointer dereference:

$ jose jwk gen -i '{"kty":"oct",,"bytes":32}' -o oct.jwk
Segmentation fault (core dumped)

Signed-off-by: Javier Martinez Canillas <8fdf2abf85d34ea8f3f979ef25dc1f25d94aca29@redhat.com>

latchset/jose,npmccallum/jose,rjpontefract/jose,npmccallum/jose,latchset/jose,npmccallum/jose,rjpontefract/jose