We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
cinatra/include/cinatra/request.hpp
Lines 731 to 734 in e461b52
I saw a lot of reference on the pointer request.buf_.data() in source code. But you also use vector.resize() here, that may cause memory reallocation.
request.buf_.data()
vector.resize()
( ̄▽ ̄")
The text was updated successfully, but these errors were encountered:
在resize之前已经把需要拷贝出来的东西都拷贝了。
Sorry, something went wrong.
READ of size 1 at 0x61d00000fabe thread T6 #0 0x761da6 in cinatra::iequal(char const*, unsigned long, char const*) #1 0x778459 in cinatra::request::get_header_value(std::basic_string_view<char, std::char_traits<char> >) const #2 ...... SUMMARY: AddressSanitizer: heap-use-after-free in cinatra::iequal(char const*, unsigned long, char const*)
Lines 53 to 56 in e461b52
struct phr_header headers_[32];
谢谢你指出这个问题,我已经增加了拷贝header了,可以保证resize的时候信息不会丢掉。
No branches or pull requests
cinatra/include/cinatra/request.hpp
Lines 731 to 734 in e461b52
I saw a lot of reference on the pointer
request.buf_.data()
in source code.But you also use
vector.resize()
here, that may cause memory reallocation.( ̄▽ ̄")
The text was updated successfully, but these errors were encountered: