TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Add heartbeat extension bounds check

69 pointsby whadarabout 11 years ago

8 comments

whadarabout 11 years ago
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 未加载
cmbausabout 11 years ago
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_about 11 years ago
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 未加载
Flowabout 11 years ago
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 未加载
kzrdudeabout 11 years ago
1 + 3 + padding and 1 + 3 + 16 are repeated. I suspect the magic 16 is actually just the padding too.
评论 #7557950 未加载
评论 #7557944 未加载
IvyMikeabout 11 years ago
<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_about 11 years ago
I wonder if OpenSSL will get some code clean up courtesy of the extra eyes that are now on the code?
yiedyieabout 11 years ago
HN front page is heartbleeding, I counted at least 8 stories.
评论 #7558039 未加载