mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 23:10:58 +00:00
Windows: NetrShareGetInfo no return buffer on error
When processing the NetrShareGetInfo() pipe service rpc do not
allocate memory for the return buffer is the path cannot be found.
Reviewed-on: http://gerrit.openafs.org/11923
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit a640e76d0f
)
Change-Id: If9636d5341e9bf7371ff4107af392c2876563f1e
Reviewed-on: http://gerrit.openafs.org/12025
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
This commit is contained in:
parent
9854f2d79a
commit
59aff46946
@ -735,22 +735,7 @@ NET_API_STATUS NetrShareGetInfo(
|
|||||||
|
|
||||||
dscp = cm_RootSCachep(userp, &req);
|
dscp = cm_RootSCachep(userp, &req);
|
||||||
|
|
||||||
/* Allocate the memory for the response */
|
InfoStruct->ShareInfo0 = NULL;
|
||||||
switch (Level) {
|
|
||||||
case 2:
|
|
||||||
InfoStruct->ShareInfo2 = MIDL_user_allocate(sizeof(SHARE_INFO_2));
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
InfoStruct->ShareInfo1 = MIDL_user_allocate(sizeof(SHARE_INFO_1));
|
|
||||||
break;
|
|
||||||
case 0:
|
|
||||||
InfoStruct->ShareInfo0 = MIDL_user_allocate(sizeof(SHARE_INFO_0));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (InfoStruct->ShareInfo0 == NULL) {
|
|
||||||
return ERROR_NOT_ENOUGH_MEMORY;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NetName will be:
|
* NetName will be:
|
||||||
@ -850,6 +835,33 @@ NET_API_STATUS NetrShareGetInfo(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (scp) {
|
if (scp) {
|
||||||
|
/* Allocate the memory for the response */
|
||||||
|
switch (Level) {
|
||||||
|
case 2:
|
||||||
|
InfoStruct->ShareInfo2 = MIDL_user_allocate(sizeof(SHARE_INFO_2));
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
InfoStruct->ShareInfo1 = MIDL_user_allocate(sizeof(SHARE_INFO_1));
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
InfoStruct->ShareInfo0 = MIDL_user_allocate(sizeof(SHARE_INFO_0));
|
||||||
|
break;
|
||||||
|
case 501:
|
||||||
|
case 502:
|
||||||
|
case 503:
|
||||||
|
case 1004:
|
||||||
|
case 1005:
|
||||||
|
case 1006:
|
||||||
|
default:
|
||||||
|
cm_ReleaseSCache(scp);
|
||||||
|
return HRESULT_FROM_WIN32(ERROR_INVALID_LEVEL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (InfoStruct->ShareInfo0 == NULL) {
|
||||||
|
cm_ReleaseSCache(scp);
|
||||||
|
return HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
|
}
|
||||||
|
|
||||||
switch (Level) {
|
switch (Level) {
|
||||||
case 2:
|
case 2:
|
||||||
/* for share level security */
|
/* for share level security */
|
||||||
|
Loading…
Reference in New Issue
Block a user