Merge pull request #14161 from ZhouyihaiDing/channel_hashkey_size

php: fix channel_credentials hashkey size error
pull/14157/head
Stanley Cheung 7 years ago committed by GitHub
commit d29d709b35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/php/ext/grpc/channel_credentials.c

@ -157,7 +157,7 @@ PHP_METHOD(ChannelCredentials, createSsl) {
} }
php_grpc_int hashkey_len = root_certs_length + cert_chain_length; php_grpc_int hashkey_len = root_certs_length + cert_chain_length;
char *hashkey = emalloc(hashkey_len); char *hashkey = emalloc(hashkey_len + 1);
if (root_certs_length > 0) { if (root_certs_length > 0) {
strcpy(hashkey, pem_root_certs); strcpy(hashkey, pem_root_certs);
} }

Loading…
Cancel
Save