yockie opened a new pull request #1056: fix heap overflow in simple_data_pool
URL: https://github.com/apache/incubator-brpc/pull/1056
 
 
   1.代码bug:
   _capacity初始值为1时,在扩容过程中,由于 1 * 3/2 == 1,所以并没有扩容,而最后的_pool[_size++] = 
data;并没有再判断size与_capacity的关系,导致堆溢出
   
   2.复现条件:
   设置了brpc server 
option的session_local_data_factory,并且设置reserved_session_local_data为1,client多并发请求时,是必现的。
   
   3.修复方法
   _capacity初始值为1时,同_capacity初始值为0一样,强制设为128,而不是通过(_capacity * 3 / 2)计算。

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to