提交 b15a93a9 编写于 作者: R Richard Levitte

Correct a faulty address assignment, and add a length check (not

really needed now, but may be needed in the future, who knows?).
上级 d9248e57
...@@ -101,11 +101,12 @@ int RAND_poll(void) ...@@ -101,11 +101,12 @@ int RAND_poll(void)
pitem = item; pitem = item;
/* Setup */ /* Setup */
while (pitems_data->length) while (pitems_data->length
&& (total_length + pitems_data->length <= 256))
{ {
pitem->length = pitems_data->length; pitem->length = pitems_data->length;
pitem->code = pitems_data->code; pitem->code = pitems_data->code;
pitem->buffer = (long *)data_buffer[total_length]; pitem->buffer = (long *)&data_buffer[total_length];
pitem->retlen = 0; pitem->retlen = 0;
total_length += pitems_data->length; total_length += pitems_data->length;
pitems_data++; pitems_data++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册