mirror of
https://git.openafs.org/openafs.git
synced 2025-01-21 00:10:15 +00:00
rx: Make identity and opaque usable with NULL vals
Make it possible to have NULL values for elements of the rx_identity and rx_opaque structures. Change-Id: I3624d490d92da3cf75da5edb91c7d4e5ce1fa937 Reviewed-on: http://gerrit.openafs.org/7260 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com> Reviewed-by: Derrick Brashear <shadow@dementix.org>
This commit is contained in:
parent
5815a04cf1
commit
e1eb0fd66a
@ -79,8 +79,11 @@ rx_identity_populate(struct rx_identity *identity, rx_identity_kind kind,
|
||||
memset(identity, 0, sizeof(struct rx_identity));
|
||||
|
||||
identity->kind = kind;
|
||||
identity->displayName = rxi_Alloc(strlen(displayName)+1);
|
||||
memcpy(identity->displayName, displayName, strlen(displayName)+1);
|
||||
|
||||
if (displayName) {
|
||||
identity->displayName = rxi_Alloc(strlen(displayName)+1);
|
||||
memcpy(identity->displayName, displayName, strlen(displayName)+1);
|
||||
}
|
||||
|
||||
rx_opaque_populate(&identity->exportedName, enameData, enameLength);
|
||||
}
|
||||
|
@ -110,6 +110,9 @@ rx_opaque_populate(struct rx_opaque *to, void *data, size_t datalen)
|
||||
to->len = 0;
|
||||
to->val = NULL;
|
||||
|
||||
if (data == NULL || datalen == 0)
|
||||
return 0;
|
||||
|
||||
code = rx_opaque_alloc(to, datalen);
|
||||
if (code)
|
||||
return code;
|
||||
|
Loading…
Reference in New Issue
Block a user