TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Add heartbeat extension bounds check

69 点作者 whadar大约 11 年前

8 条评论

whadar大约 11 年前
This blog post explains the code: <a href="http://blog.existentialize.com/diagnosis-of-the-openssl-heartbleed-bug.html" rel="nofollow">http:&#x2F;&#x2F;blog.existentialize.com&#x2F;diagnosis-of-the-openssl-hear...</a>
评论 #7558881 未加载
评论 #7557979 未加载
cmbaus大约 11 年前
I&#x27;m sort of surprised an allocation occurs every time the heartbeat is sent. That is a lot of trips to the heap.<p>I&#x27;m not very familiar with how TLS heartbeats are implemented, but I wonder if the buffer could have just been alloc&#x27;d once when the connection was created.
评论 #7558859 未加载
评论 #7558240 未加载
Cthulhu_大约 11 年前
I like how those bounds checks (the ifs) have no curly braces, as if that Apple security bug didn&#x27;t wake people up about such trivial opportunities for bugs.
评论 #7559782 未加载
评论 #7563616 未加载
评论 #7558796 未加载
Flow大约 11 年前
I wonder if any of the existing static code analyzers would have found this?<p>PVS-Studio checks some open source projects and posts part of the results on their blog. I did a search and found that they did take a look at OpenSSL in 2012.<p><a href="http://www.viva64.com/en/b/0183/" rel="nofollow">http:&#x2F;&#x2F;www.viva64.com&#x2F;en&#x2F;b&#x2F;0183&#x2F;</a><p>And Coverity: <a href="https://scan.coverity.com/projects/294" rel="nofollow">https:&#x2F;&#x2F;scan.coverity.com&#x2F;projects&#x2F;294</a>
评论 #7558775 未加载
kzrdude大约 11 年前
1 + 3 + padding and 1 + 3 + 16 are repeated. I suspect the magic 16 is actually just the padding too.
评论 #7557950 未加载
评论 #7557944 未加载
IvyMike大约 11 年前
<p><pre><code> &#x2F;* Read type and payload length first *&#x2F; </code></pre> And now this is actually the second thing the code does, not the first.
评论 #7557991 未加载
voltagex_大约 11 年前
I wonder if OpenSSL will get some code clean up courtesy of the extra eyes that are now on the code?
yiedyie大约 11 年前
HN front page is heartbleeding, I counted at least 8 stories.
评论 #7558039 未加载