diff options
author | Julien Boeuf <jboeuf@google.com> | 2015-12-07 11:34:12 -0800 |
---|---|---|
committer | Julien Boeuf <jboeuf@google.com> | 2015-12-07 11:34:12 -0800 |
commit | 4c8e8181fe09d45724ed85173af22627a03808e6 (patch) | |
tree | 8880b31ac90832781b8d24b03a549c72f87d0eff /src/core | |
parent | 9d43a676dca9c9b77016cf01ac2b348bb254d528 (diff) |
Adding common tests for TSI.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/tsi/transport_security.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/tsi/transport_security.c b/src/core/tsi/transport_security.c index c39e584496..db219a50a6 100644 --- a/src/core/tsi/transport_security.c +++ b/src/core/tsi/transport_security.c @@ -145,7 +145,9 @@ void tsi_frame_protector_destroy(tsi_frame_protector *self) { tsi_result tsi_handshaker_get_bytes_to_send_to_peer(tsi_handshaker *self, unsigned char *bytes, size_t *bytes_size) { - if (self == NULL) return TSI_INVALID_ARGUMENT; + if (self == NULL || bytes == NULL || bytes_size == NULL) { + return TSI_INVALID_ARGUMENT; + } if (self->frame_protector_created) return TSI_FAILED_PRECONDITION; return self->vtable->get_bytes_to_send_to_peer(self, bytes, bytes_size); } @@ -153,7 +155,9 @@ tsi_result tsi_handshaker_get_bytes_to_send_to_peer(tsi_handshaker *self, tsi_result tsi_handshaker_process_bytes_from_peer(tsi_handshaker *self, const unsigned char *bytes, size_t *bytes_size) { - if (self == NULL) return TSI_INVALID_ARGUMENT; + if (self == NULL || bytes == NULL || bytes_size == NULL) { + return TSI_INVALID_ARGUMENT; + } if (self->frame_protector_created) return TSI_FAILED_PRECONDITION; return self->vtable->process_bytes_from_peer(self, bytes, bytes_size); } |