ChadF

Results 8 issues of ChadF

Signed-off-by: Chad Fraleigh Maintainer: @jow- Run tested: ramips-mt7620, Wavlink WL-WN530HG4, OpenWrt 21.02.3 r16554-1d4dea6d4f / LuCI openwrt-21.02 branch git-22.167.28411-ee8170b, - Dropped in new /etc/init.d/nlbwmon, - Ran: /etc/init.d/nlbwmon enable - Did init.d...

Signed-off-by: Chad Fraleigh The database is currently always saved twice. Change to only save a second time when merging with existing file.

This replaces pull request #1939.

Transports::GetRandomPeer() randomly fails due to division by zero. ``` ==38082==ERROR: AddressSanitizer: FPE on unknown address 0x00000186426a (pc 0x00000186426a bp 0x7fffdf3f4cf0 sp 0x7fffdf3f44a0 T7) #0 0x186426a in std::__1::shared_ptr i2p::transport::Transports::GetRandomPeer(i2p::transport::Transports::GetRandomPeer(bool) const::$_3) const...

Found multiple buffer over-reads while fuzzing. ``` ==23556==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x614000000dcc at pc 0x000000dd8ce7 bp 0x7fffffffc3f0 sp 0x7fffffffbbc0 READ of size 2 at 0x614000000dcc thread T0 #0 0xdd8ce6...

Currently the entire model is always loaded into memory to perform hash, and once again if a new model is downloaded. This could have a significant impact on memory usage...

`os.path` expects local OS specific identifiers and may not be reliable for URLs. Using existing `url.split()` values avoids any potential issues and also eliminates a redundant function operation.