Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: issue4092 #4097

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

fix: issue4092 #4097

wants to merge 5 commits into from

Conversation

wln32
Copy link
Member

@wln32 wln32 commented Jan 3, 2025

Fixes #4092 基础类型的切片数组,不再递归循环验证,防止一些基础类型切片容量过大导致内存泄漏,具体见issue

case reflect.Ptr:
// []*struct
// []*int
loop = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 针对[]string, []int等基础类型也不支持了吗?这样会有兼容问题的。
  • 个人建议改进如下:
    • 针对太大块的提交内容,定义校验规则没有意义,建议使用侧去掉校验规则,
    • 组件增加对校验内容大小的限制,比如默认限制1K

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

github.com/gogf/gf/v2/util/gvalid: valid binary field,a large amount of memory is consumed
2 participants