Trac issues
https://gitlab.torproject.org/legacy/trac/-/issues
2020-06-13T15:26:15Z
https://gitlab.torproject.org/legacy/trac/-/issues/26284
Out-of-bounds smartlist access in protover_compute_vote()
2020-06-13T15:26:15Z
rl1987
Out-of-bounds smartlist access in protover_compute_vote()
When compiled with `DEBUG_SMARTLIST`:
```
dir/v3_networkstatus: [forking] Jun 03 15:26:03.147 [err] tor_assertion_failed_: Bug: ./src/common/container.h:70: smartlist_get: Assertion sl->num_used > idx failed; aborting. (on Tor 0.3.4.1-a...
When compiled with `DEBUG_SMARTLIST`:
```
dir/v3_networkstatus: [forking] Jun 03 15:26:03.147 [err] tor_assertion_failed_: Bug: ./src/common/container.h:70: smartlist_get: Assertion sl->num_used > idx failed; aborting. (on Tor 0.3.4.1-alpha-dev b32d8d6025fdc1be)
Jun 03 15:26:03.151 [err] Bug: Assertion sl->num_used > idx failed in smartlist_get at ./src/common/container.h:70. Stack trace: (on Tor 0.3.4.1-alpha-dev b32d8d6025fdc1be)
Jun 03 15:26:03.151 [err] Bug: 0 test 0x000000010ffdb108 log_backtrace + 72 (on Tor 0.3.4.1-alpha-dev b32d8d6025fdc1be)
Jun 03 15:26:03.152 [err] Bug: 1 test 0x0000000110053771 tor_assertion_failed_ + 385 (on Tor 0.3.4.1-alpha-dev b32d8d6025fdc1be)
Jun 03 15:26:03.152 [err] Bug: 2 test 0x000000010fdd9a7a smartlist_get + 490 (on Tor 0.3.4.1-alpha-dev b32d8d6025fdc1be)
Jun 03 15:26:03.152 [err] Bug: 3 test 0x000000010fdd8013 protover_compute_vote + 3315 (on Tor 0.3.4.1-alpha-dev b32d8d6025fdc1be)
Jun 03 15:26:03.153 [err] Bug: 4 test 0x000000010ff41617 networkstatus_compute_consensus + 8823 (on Tor 0.3.4.1-alpha-dev b32d8d6025fdc1be)
Jun 03 15:26:03.153 [err] Bug: 5 test 0x000000010f76ac5a test_a_networkstatus + 13930 (on Tor 0.3.4.1-alpha-dev b32d8d6025fdc1be)
Jun 03 15:26:03.154 [err] Bug: 6 test 0x000000010fa20684 testcase_run_bare_ + 308 (on Tor 0.3.4.1-alpha-dev b32d8d6025fdc1be)
Jun 03 15:26:03.154 [err] Bug: 7 test 0x000000010fa203bc testcase_run_one + 2924 (on Tor 0.3.4.1-alpha-dev b32d8d6025fdc1be)
Jun 03 15:26:03.154 [err] Bug: 8 test 0x000000010fa21e31 tinytest_main + 2321 (on Tor 0.3.4.1-alpha-dev b32d8d6025fdc1be)
Jun 03 15:26:03.155 [err] Bug: 9 test 0x000000010fa1dffa main + 2218 (on Tor 0.3.4.1-alpha-dev b32d8d6025fdc1be)
Jun 03 15:26:03.155 [err] Bug: 10 libdyld.dylib 0x00007fff6619f015 start + 1 (on Tor 0.3.4.1-alpha-dev b32d8d6025fdc1be)
Jun 03 15:26:03.155 [err] Bug: 11 ??? 0x0000000000000001 0x0 + 1 (on Tor 0.3.4.1-alpha-dev b32d8d6025fdc1be)
[Lost connection!]
[v3_networkstatus FAILED]
```
Tor: 0.2.9.x-final
rl1987
rl1987
https://gitlab.torproject.org/legacy/trac/-/issues/26283
smartlist_len cast to double
2020-06-13T15:26:14Z
rl1987
smartlist_len cast to double
When building with `DEBUG_SMARTLIST`:
```
src/or/routerlist.c:2767:45: warning: cast from function call of type 'int' to non-matching type 'double' [-Wbad-function-cast]
return ((double)n_with_descs) / (double)smartlist_len(sl);
...
When building with `DEBUG_SMARTLIST`:
```
src/or/routerlist.c:2767:45: warning: cast from function call of type 'int' to non-matching type 'double' [-Wbad-function-cast]
return ((double)n_with_descs) / (double)smartlist_len(sl);
^~~~~~~~~~~~~~~~~
1 warning generated.
```
```
src/or/routerlist.c:2767:45: warning: cast from function call of type 'int' to non-matching type 'double' [-Wbad-function-cast]
return ((double)n_with_descs) / (double)smartlist_len(sl);
^~~~~~~~~~~~~~~~~
1 warning generated.
```
Tor: 0.3.4.x-final
https://gitlab.torproject.org/legacy/trac/-/issues/26282
Smartlist index implicitly converted to int
2020-06-13T15:26:14Z
rl1987
Smartlist index implicitly converted to int
When building with `DEBUG_SMARTLIST`:
```
src/common/util.c:4816:45: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
const char *s = smartlist_get(env_vars, i);
...
When building with `DEBUG_SMARTLIST`:
```
src/common/util.c:4816:45: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
const char *s = smartlist_get(env_vars, i);
~~~~~~~~~~~~~ ^
src/common/util.c:4846:54: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
const char *s = smartlist_get(env_vars_sorted, i);
~~~~~~~~~~~~~ ^
2 warnings generated.
```
```
src/common/util.c:4816:45: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
const char *s = smartlist_get(env_vars, i);
~~~~~~~~~~~~~ ^
src/common/util.c:4846:54: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
const char *s = smartlist_get(env_vars_sorted, i);
~~~~~~~~~~~~~ ^
2 warnings generated.
```
```
src/or/control.c:4627:43: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
const char *arg = smartlist_get(args, i);
~~~~~~~~~~~~~ ^
1 warning generated.
```
```
src/or/geoip.c:153:57: warning: implicit conversion loses integer precision: 'intptr_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
geoip_country_t *c = smartlist_get(geoip_countries, idx);
~~~~~~~~~~~~~ ^~~
1 warning generated.
```
```
src/or/control.c:4627:43: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
const char *arg = smartlist_get(args, i);
~~~~~~~~~~~~~ ^
1 warning generated.
```
```
src/or/geoip.c:153:57: warning: implicit conversion loses integer precision: 'intptr_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
geoip_country_t *c = smartlist_get(geoip_countries, idx);
~~~~~~~~~~~~~ ^~~
1 warning generated.
```
Tor: 0.3.5.x-final
rl1987
rl1987