mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 07:20:11 +00:00
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 <shadow@your-file-system.com> Tested-by: BuildBot <buildbot@rampaginggeek.com>
This commit is contained in:
parent
5538633c9f
commit
a060159b95
@ -174,7 +174,7 @@ addOpaque(struct ktc_setTokenData *jar, char *data, size_t len)
|
|||||||
|
|
||||||
entry = jar->tokens.tokens_len;
|
entry = jar->tokens.tokens_len;
|
||||||
jar->tokens.tokens_val = realloc(jar->tokens.tokens_val,
|
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_len++;
|
||||||
jar->tokens.tokens_val[entry].token_opaque_val = data;
|
jar->tokens.tokens_val[entry].token_opaque_val = data;
|
||||||
jar->tokens.tokens_val[entry].token_opaque_len = len;
|
jar->tokens.tokens_val[entry].token_opaque_len = len;
|
||||||
|
Loading…
Reference in New Issue
Block a user