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

vector_push_back NULL ptr, abort in vector_destroy #48

Open
fastfading opened this issue Dec 10, 2020 · 1 comment
Open

vector_push_back NULL ptr, abort in vector_destroy #48

fastfading opened this issue Dec 10, 2020 · 1 comment

Comments

@fastfading
Copy link

vector_push_back null crash in vector_destroy

    vector_t *pvec_charptr = create_vector(char *);
    vector_init(pvec_charptr);
    char *p;
    char *q = NULL;
    vector_push_back(pvec_charptr, p);
    vector_push_back(pvec_charptr, q);
    vector_destroy(pvec_charptr);
@fastfading
Copy link
Author

vector: cstl_basic_string_private.c:254: _basic_string_destroy_auxiliary: Assertion `_basic_string_is_inited(pt_basic_string) || _basic_string_is_created(pt_basic_string)' failed.
Aborted

这里应该不做校验, vector<char*> 存的指针, 应该可以为空

@fastfading fastfading changed the title vector_push_back NULL crash in vector_destroy vector_push_back NULL ptr, abort in vector_destroy Dec 11, 2020
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

No branches or pull requests

1 participant