sshd 的 Git diff 解释

标签 git sshd fuzzing

我有一个差异:

diff --git openbsd-compat/arc4random.c openbsd-compat/arc4random.c
--- openbsd-compat/arc4random.c
+++ openbsd-compat/arc4random.c
@@ -242,7 +242,7 @@ void
 arc4random_buf(void *buf, size_t n)
 {
        _ARC4_LOCK();
-       _rs_random_buf(buf, n);
+       memset(buf, 0, n);
        _ARC4_UNLOCK();
 }
 # endif /* !HAVE_ARC4RANDOM_BUF */

但我不明白,我究竟需要如何修改:

https://github.com/openbsd/src/blob/master/lib/libc/crypt/arc4random.c

代码与差异完全相同。

有人可以解释一下吗?还是我看错了 arc4random.c 文件?只是想减少基于测试目的的随机性:http://www.vegardno.net/2017/03/fuzzing-openssh-daemon-using-afl.html

最佳答案

您需要 change the line 195 , 这是删除行

-       _rs_random_buf(buf, n);

并添加一行:

+       memset(buf, 0, n);

(代替)

更改行上方和下方的行是diff hunk 上下文的一部分。在“Unexpected result in git-diff”中查看更多信息。 这将手动将该补丁应用于您的 src/arc4random.c 版本。

关于sshd 的 Git diff 解释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49721901/

相关文章:

windows - 从bitvise SSH服务器控制面板导出Windows帐户列表

php - 我如何扫描/模糊测试我的代码以查找漏洞?

linux - 使用 '-sanitizer-coverage-prune-blocks=0' 运行 honggfuzz 错误

git - 为什么 gitignore 在这种情况下不起作用?

django - Git merge 忽略的迁移文件

linux - 在 SSHD 配置中, "MaxStartups 10:30:60"是什么意思?

git - 如何在提交到 master 之前创建分支

git - 在 github 上标记消息

php - Docker 容器中的 SSH 导致 HTTP 404