Closed adcen0107 closed 2 years ago
xqc_sample.c xqc_generate_sample() if (sampler->interval != 0) { / unit of interval is us / sampler->delivery_rate = (uint64_t)(1e6 * sampler->delivered / sampler->interval); // error happened }
xqc_sample.h uint32_t delivery_rate;
这一句:sampler->delivery_rate = (uint64_t)(1e6 * sampler->delivered / sampler->interval);
sampler->delivery_rate是uint32_t,即赋值运算符左边是32位,右边是64位,有溢出风险。
No response
We'd appreciate it if you could tell us what and how the error happened.
Hello, because there are no reproducible steps, we will close this issue. If necessary, reopen an issue and describe it in detail.
What happened?
xqc_sample.c xqc_generate_sample()
if (sampler->interval != 0) { / unit of interval is us / sampler->delivery_rate = (uint64_t)(1e6 * sampler->delivered / sampler->interval); // error happened }
xqc_sample.h uint32_t delivery_rate;
Steps To Reproduce
这一句:sampler->delivery_rate = (uint64_t)(1e6 * sampler->delivered / sampler->interval);
sampler->delivery_rate是uint32_t,即赋值运算符左边是32位,右边是64位,有溢出风险。
Relevant log output
No response