mirror of
https://github.com/darlinghq/darlingserver.git
synced 2024-11-23 04:19:44 +00:00
Merge pull request #13 from darlinghq/fix_processor_count_out_of_bounds
Fix Out Of Bounds If Count Exceeds MAX_SCHED_CPUS
This commit is contained in:
commit
901b29cdb8
@ -31,7 +31,13 @@ void dtape_processor_init(void) {
|
|||||||
simple_lock_init(&processor_list_lock, 0);
|
simple_lock_init(&processor_list_lock, 0);
|
||||||
|
|
||||||
processor_count = get_nprocs_conf();
|
processor_count = get_nprocs_conf();
|
||||||
|
if (processor_count > MAX_SCHED_CPUS)
|
||||||
|
processor_count = MAX_SCHED_CPUS;
|
||||||
|
|
||||||
processor_avail_count = get_nprocs();
|
processor_avail_count = get_nprocs();
|
||||||
|
if (processor_avail_count > MAX_SCHED_CPUS)
|
||||||
|
processor_avail_count = MAX_SCHED_CPUS;
|
||||||
|
|
||||||
processor_avail_count_user = processor_avail_count;
|
processor_avail_count_user = processor_avail_count;
|
||||||
primary_processor_avail_count = processor_avail_count;
|
primary_processor_avail_count = processor_avail_count;
|
||||||
primary_processor_avail_count_user = processor_avail_count;
|
primary_processor_avail_count_user = processor_avail_count;
|
||||||
|
Loading…
Reference in New Issue
Block a user