aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/security
diff options
context:
space:
mode:
authorGravatar Nicolas "Pixel" Noble <pixel@nobis-crew.org>2015-01-29 02:12:32 +0100
committerGravatar Nicolas "Pixel" Noble <pixel@nobis-crew.org>2015-01-29 02:12:32 +0100
commita2a03d488ff8459e5001f158a6b9ce72c6e2133f (patch)
treed3823f09f1d43019d671b149af30f68730ec61a6 /src/core/security
parent163a2d540ce18bcc0df757dcc789c8ee214e34d4 (diff)
Cleaning up some code.
The correct thing to do here is to use memcpy instead of strncpy.
Diffstat (limited to 'src/core/security')
-rw-r--r--src/core/security/json_token.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/security/json_token.c b/src/core/security/json_token.c
index 82bd9b505a..54cb7931c3 100644
--- a/src/core/security/json_token.c
+++ b/src/core/security/json_token.c
@@ -216,10 +216,10 @@ static char *dot_concat_and_free_strings(char *str1, char *str2) {
size_t result_len = str1_len + 1 /* dot */ + str2_len;
char *result = gpr_malloc(result_len + 1 /* NULL terminated */);
char *current = result;
- strncpy(current, str1, str1_len);
+ memcpy(current, str1, str1_len);
current += str1_len;
*(current++) = '.';
- strncpy(current, str2, str2_len);
+ memcpy(current, str2, str2_len);
current += str2_len;
GPR_ASSERT((current - result) == result_len);
*current = '\0';