Commit f13739d
committed
librlist: ignore missing ranks in rlist_mark_up/down
Problem: rlist_mark_state() doesn't check the return value from
rlist_find_rank(). If a rank is passed to rlist_mark_up() or
rlist_mark_down() that doesn't exist in the current rlist, then this
will result in a dereference of NULL and a segfault.
Skip ranks that don't exist in rlist_mark_start(), effectively
ignoring invalid ranks passed to rlist_mark_up() and rlist_mark_down().
This is simpler than returning an error, which would require multiple
iterations of the ranks idset as well as more complex error handling
on the caller side.1 parent 111d75b commit f13739d
1 file changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2313 | 2313 | | |
2314 | 2314 | | |
2315 | 2315 | | |
2316 | | - | |
2317 | | - | |
2318 | | - | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
2319 | 2321 | | |
2320 | 2322 | | |
2321 | 2323 | | |
| |||
0 commit comments