If GetTokenEx is called with a NULL cellName, it means use the
local cell. To do this with the legacy interface, a 0 length string
must be used for the cell instance of the ktc_principal passed to
GetToken. Fix this so that we do so, rather than attempting to
strcpy(..., NULL) which never ends well.
Caught by clang-analyzer
Change-Id: I53d9bdf0fc280ee073a2fb7693659269df29c2eb
Reviewed-on: http://gerrit.openafs.org/7840
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
memset(ktcToken, 0, sizeof(struct ktc_token));
strcpy(server.name, "afs");
- strcpy(server.cell, cellName);
+
+ if (cellName != NULL)
+ strcpy(server.cell, cellName);
+
code = GetToken(&server, ktcToken, sizeof(struct ktc_token),
NULL /*client*/, &viceid);
if (code == 0) {