Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
9434e199
Commit
9434e199
authored
16 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
server: Limit the number of allocated handles before running out of memory.
parent
9960ab24
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
server/handle.c
+5
-5
5 additions, 5 deletions
server/handle.c
server/trace.c
+1
-0
1 addition, 0 deletions
server/trace.c
with
6 additions
and
5 deletions
server/handle.c
+
5
−
5
View file @
9434e199
...
...
@@ -64,6 +64,7 @@ static struct handle_table *global_table;
#define RESERVED_ALL (RESERVED_INHERIT | RESERVED_CLOSE_PROTECT)
#define MIN_HANDLE_ENTRIES 32
#define MAX_HANDLE_ENTRIES 0x00ffffff
/* handle to table index conversion */
...
...
@@ -191,13 +192,12 @@ struct handle_table *alloc_handle_table( struct process *process, int count )
static
int
grow_handle_table
(
struct
handle_table
*
table
)
{
struct
handle_entry
*
new_entries
;
int
count
=
table
->
count
;
int
count
=
min
(
table
->
count
*
2
,
MAX_HANDLE_ENTRIES
)
;
if
(
count
>=
INT_MAX
/
2
)
return
0
;
count
*=
2
;
if
(
!
(
new_entries
=
realloc
(
table
->
entries
,
count
*
sizeof
(
struct
handle_entry
)
)))
if
(
count
==
table
->
count
||
!
(
new_entries
=
realloc
(
table
->
entries
,
count
*
sizeof
(
struct
handle_entry
)
)))
{
set_error
(
STATUS_
NO_MEMORY
);
set_error
(
STATUS_
INSUFFICIENT_RESOURCES
);
return
0
;
}
table
->
entries
=
new_entries
;
...
...
This diff is collapsed.
Click to expand it.
server/trace.c
+
1
−
0
View file @
9434e199
...
...
@@ -4582,6 +4582,7 @@ static const struct
{
"HANDLE_NOT_CLOSABLE"
,
STATUS_HANDLE_NOT_CLOSABLE
},
{
"ILLEGAL_FUNCTION"
,
STATUS_ILLEGAL_FUNCTION
},
{
"INSTANCE_NOT_AVAILABLE"
,
STATUS_INSTANCE_NOT_AVAILABLE
},
{
"INSUFFICIENT_RESOURCES"
,
STATUS_INSUFFICIENT_RESOURCES
},
{
"INVALID_CID"
,
STATUS_INVALID_CID
},
{
"INVALID_DEVICE_REQUEST"
,
STATUS_INVALID_DEVICE_REQUEST
},
{
"INVALID_FILE_FOR_SECTION"
,
STATUS_INVALID_FILE_FOR_SECTION
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment