dashpay / dash

Dash - Reinventing Cryptocurrency
https://www.dash.org
MIT License
1.49k stars 1.2k forks source link

Static analysis: while() infinite loop #3585

Open sidhujag opened 4 years ago

sidhujag commented 4 years ago

Hello again,

https://github.com/dashpay/dash/blob/master/src/llmq/quorums_utils.cpp#L63

This statement was running infinite loop when i ran a test. It seems it changed in develop branch, but code still faulty:

https://github.com/dashpay/dash/blob/develop/src/llmq/quorums_utils.cpp#L124

I was running the llmqdkgerrors test and was actually hitting this on the develop branch version.

Scanning through for other while loops these look interesting as well: https://github.com/dashpay/dash/blob/develop/src/evo/deterministicmns.cpp#L929 https://github.com/dashpay/dash/blob/develop/src/llmq/quorums_utils.h#L64

PastaPastaPasta commented 4 years ago

@sidhujag I'm so sorry, looks like we absolutely ignored you...

The first loop you bring up is very interesting and looks to me like it should be a problem

@UdjinM6 or @xdustinface can you confirm?