Skip to content
Snippets Groups Projects
Commit d7bf9013 authored by Morris Jette's avatar Morris Jette
Browse files

Fix for possible unsigned iterator with negative bounds

Coverity 44943, 44944
parent 8e628b01
No related branches found
No related tags found
No related merge requests found
......@@ -335,9 +335,9 @@ clear_bit: /* This node is not usable by this job */
/* given an "avail" node_bitmap, return a corresponding "avail" core_bitmap */
bitstr_t *_make_core_bitmap(bitstr_t *node_map)
{
uint32_t n, c, nodes, size;
uint32_t c, nodes, size;
uint32_t coff;
int i_first, i_last;
int i, i_first, i_last;
nodes = bit_size(node_map);
size = cr_get_coremap_offset(nodes);
......@@ -348,9 +348,9 @@ bitstr_t *_make_core_bitmap(bitstr_t *node_map)
i_last = bit_fls(node_map);
else
i_last = -2;
for (n = i_first, c = 0; n <= i_last; n++) {
if (bit_test(node_map, n)) {
coff = cr_get_coremap_offset(n + 1);
for (i = i_first, c = 0; i <= i_last; i++) {
if (bit_test(node_map, i)) {
coff = cr_get_coremap_offset(i + 1);
while (c < coff) {
bit_set(core_map, c++);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment