From a060159b95c0d29afaee1e8eac5827c7f8b40e47 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Wed, 26 Sep 2012 07:37:11 -0400 Subject: [PATCH] auth: token jar handling should realloc correctly instead of reallocing n+1 tokens, we would realloc 1 token plus N bytes Change-Id: Idb5a20b5b9becc9d48cb645bbc0bd26459220ccd Reviewed-on: http://gerrit.openafs.org/8163 Reviewed-by: Derrick Brashear Tested-by: BuildBot --- src/auth/token.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/auth/token.c b/src/auth/token.c index 9d99a1e68b..5e1054383c 100644 --- a/src/auth/token.c +++ b/src/auth/token.c @@ -174,7 +174,7 @@ addOpaque(struct ktc_setTokenData *jar, char *data, size_t len) entry = jar->tokens.tokens_len; jar->tokens.tokens_val = realloc(jar->tokens.tokens_val, - entry + 1 * sizeof(token_opaque)); + (entry + 1) * sizeof(token_opaque)); jar->tokens.tokens_len++; jar->tokens.tokens_val[entry].token_opaque_val = data; jar->tokens.tokens_val[entry].token_opaque_len = len;