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

openvpn.c: handle strdup failure #693

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chipitsine
Copy link
Contributor

No description provided.

@@ -1417,6 +1417,11 @@ OnPassword(connection_t *c, char *msg)
param->flags |= FLAG_CR_TYPE_SCRV1;
param->flags |= (*(chstr + 3) != '0') ? FLAG_CR_ECHO : 0;
param->str = strdup(chstr + 5);
if (!param->str)
{
WriteStatusLog(c, L"GUI> ", L"Error: Out of memory - ignoring dynamic challenge", false);
Copy link
Collaborator

@selvanair selvanair Jul 10, 2024

Choose a reason for hiding this comment

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

This is actually static challenge :) That said, param->str is later used as if (param->str) { <display the string> } so failure here only leads to the challenge prompt string in the dialog displayed as empty, not a fatal error.

That said, erroring out here like this is fine too -- once out of memory the process is going to die sooner or later anyway.

@chipitsine chipitsine marked this pull request as draft July 10, 2024 16:24
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.

2 participants