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 leaks in priv_encode_gost() #182

Merged
merged 1 commit into from Oct 16, 2019
Merged

Fix leaks in priv_encode_gost() #182

merged 1 commit into from Oct 16, 2019

Conversation

outspace
Copy link
Contributor

Исправил утечки которые описаны в #179.

Для algobj вызов делать не нужно.

Заметил что не проверялось выделение octet, до него тоже дописал проверку.

@outspace outspace mentioned this pull request Oct 15, 2019
@vt-alt
Copy link
Member

vt-alt commented Oct 15, 2019

Заребейсите плс последний коммит к предпоследнему иначе получается, что вы пушите коммит с явной ошибкой и потом коммит с фиксом. Так не принято делать. Сделать можно так: git rebase -i HEAD~~ там у "Fix typo" напишите вместо pick squash. И потом git push -f.

@outspace
Copy link
Contributor Author

@vt-alt спасибо, сделал.

@vt-alt
Copy link
Member

vt-alt commented Oct 15, 2019

        octet = ASN1_STRING_new();        
        if (!octet || !ASN1_OCTET_STRING_set(octet, buf, key_len)) {
            ASN1_STRING_free(params);
            OPENSSL_free(buf);
            return 0;
        }

Похоже, что если ASN1_STRING_new создал объект, но ASN1_OCTET_STRING_set не сработал, то будет memory leak.

@outspace
Copy link
Contributor Author

Ну вообще да) сейчас подправлю

@vt-alt
Copy link
Member

vt-alt commented Oct 15, 2019

Выглядит ок. (К сожалению нет тестов на этот код.) У вас сейчас в дескрипшене коммита написано "Fix typo", хотя эта надпись устарела. Можно исправить так: git commit --amend и там её стереть.

@beldmit beldmit merged commit e654182 into gost-engine:master Oct 16, 2019
@beldmit
Copy link
Contributor

beldmit commented Oct 16, 2019

Спасибо!

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.

None yet

3 participants