Add files via upload - #16
Open
joyfaker wants to merge 1 commit into
Open
Conversation
| @@ -0,0 +1,82 @@ | |||
| // Protocol Buffers - Google's data interchange format | |||
There was a problem hiding this comment.
🔴 AI 代码审查发现问题
📋 问题概述
使用strcpy函数导致缓冲区溢出漏洞。当用户输入长度超过MAX_BUFFER(10)时,会覆盖相邻内存区域
📍 问题详情
🔴 问题 1 | 严重程度: HIGH | 行号: 1
💬 详细说明:
- 攻击者可以构造超长输入导致栈溢出,可能执行任意代码或程序崩溃
💡 修复建议:
使用strncpy替代strcpy,并确保目标缓冲区大小限制
✅ 修复示例:
strncpy(buffer, user_input, sizeof(buffer) - 1);
buffer[sizeof(buffer) - 1] = '\0';
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.