Commit a7c36aa
committed
exmdb_client: fix crash when replacing old connections
==774==ERROR: AddressSanitizer: global-buffer-overflow; READ of size 1
f0 _M_reset /usr/include/c++/15/optional:337
f4 ~remote_svr lib/exmdb_client.cpp:82
f9 erase /usr/include/c++/15/bits/list.tcc:153
f10 exmdb_client_get_connection lib/exmdb_client.cpp:475
Fix these issues:
* The inside of the loop referenced `i`, which is not right; the
iterator is `j`.
* `mdcl_server_list.erase(j.base())`: the iterator was not secured
against removal of the element it points to.
* The loop ran in the wrong direction (from the end - where `i`
was just added previously).
Fixes: gromox-3.4-160-g242b860361 parent bc506b1 commit a7c36aa
1 file changed
+16
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
477 | 483 | | |
478 | 484 | | |
479 | 485 | | |
| |||
0 commit comments