提交 acd410dc 编写于 作者: D Dr. Stephen Henson

check buffer is larger enough before overwriting

上级 161cc82d
......@@ -168,10 +168,9 @@ int fbytes(unsigned char *buf, int num)
return 0;
}
fbytes_counter ++;
ret = BN_bn2bin(tmp, buf);
if (ret == 0 || ret != num)
if (num != BN_num_bytes(tmp) || !BN_bn2bin(tmp, buf))
ret = 0;
else
else
ret = 1;
if (tmp)
BN_free(tmp);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册