summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_samr_nt.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-03-29 21:50:21 +0000
committerJeremy Allison <jra@samba.org>2002-03-29 21:50:21 +0000
commita5dc8cb59145b400b6145b9f13231efdb7ff047c (patch)
tree5b285ba9382fc2e27e7d9226e4b06a17fb8d60a2 /source3/rpc_server/srv_samr_nt.c
parentb94791f1d4a34d8c845dcfc7d1689e4131acab8e (diff)
downloadsamba-a5dc8cb59145b400b6145b9f13231efdb7ff047c.tar.gz
samba-a5dc8cb59145b400b6145b9f13231efdb7ff047c.tar.bz2
samba-a5dc8cb59145b400b6145b9f13231efdb7ff047c.zip
Don't core dump listing thousands of users in usrmgr.
Jeremy. (This used to be commit c6566fa5fadf37a2b133e7be1f13c0de93efab34)
Diffstat (limited to 'source3/rpc_server/srv_samr_nt.c')
-rw-r--r--source3/rpc_server/srv_samr_nt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index e47619eb74..c83f6b3d8d 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -972,10 +972,10 @@ NTSTATUS _samr_query_dispinfo(pipes_struct *p, SAMR_Q_QUERY_DISPINFO *q_u, SAMR_
}
/* calculate the size and limit on the number of entries we will return */
- temp_size=(enum_context+max_entries)*struct_size;
+ temp_size=max_entries*struct_size;
if (temp_size>max_size) {
- max_entries=max_size/struct_size;
+ max_entries=MIN((max_size/struct_size),max_entries);;
DEBUG(5, ("samr_reply_query_dispinfo: buffer size limits to only %d entries\n", max_entries));
}