diff options
author | Daiki Ueno <dueno@redhat.com> | 2017-05-29 17:15:19 +0200 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2017-05-29 17:28:51 +0200 |
commit | a2a2108fce9a5cebaee17f29bda8d9edf6a0fbc8 (patch) | |
tree | 1b00a8418d6f1323287bf9bde6763a4dba403558 /p11-kit | |
parent | 3e65d8a23b1f0e1a4d132cf04fdbc9d588cbe02f (diff) |
rpc: Avoid calling memcmp() on NULL buffer
Spotted by clang-analyzer.
Diffstat (limited to 'p11-kit')
-rw-r--r-- | p11-kit/rpc-message.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/p11-kit/rpc-message.c b/p11-kit/rpc-message.c index 32f5a45..803063f 100644 --- a/p11-kit/rpc-message.c +++ b/p11-kit/rpc-message.c @@ -191,7 +191,9 @@ p11_rpc_message_parse (p11_rpc_message *msg, msg->sigverify = msg->signature; /* Verify the incoming signature */ - if (!p11_rpc_buffer_get_byte_array (msg->input, &msg->parsed, &val, &len)) { + if (!p11_rpc_buffer_get_byte_array (msg->input, &msg->parsed, &val, &len) || + /* This can happen if the length header == 0xffffffff */ + val == NULL) { p11_message ("invalid message: couldn't read signature"); return false; } |