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 memory access error in evenv_handler #858

Merged
merged 1 commit into from
May 19, 2023

Conversation

hongweipeng
Copy link
Contributor

迭代器在 ++readerIter; 继续使用,会造成内存访问错误。示例:

#include <iostream>
#include <vector>

int main() {
    std::vector<int> myVector {1, 2, 3, 4, 5};

    // 使用迭代器遍历 vector
    for (auto it = myVector.begin(); it != myVector.end(); ) {
            ++it;
        std::cout << *it << " ";
    }

    return 0;
}

实测:

图片

@messixukejia messixukejia requested a review from yyuuttaaoo May 18, 2023 06:06
@messixukejia
Copy link
Collaborator

很仔细👍

方便的话可以把贵公司的使用场景登记下,多谢 #693

@yyuuttaaoo yyuuttaaoo merged commit 896cb86 into alibaba:main May 19, 2023
@yyuuttaaoo yyuuttaaoo added the bug Something isn't working label May 19, 2023
@yyuuttaaoo yyuuttaaoo added this to the v1.6 milestone Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants