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

string memory of yara cli not correctly freed #1963

Open
z16166 opened this issue Sep 15, 2023 · 0 comments
Open

string memory of yara cli not correctly freed #1963

z16166 opened this issue Sep 15, 2023 · 0 comments
Labels

Comments

@z16166
Copy link

z16166 commented Sep 15, 2023

At the very end of _tmain() in yara cli, there is the following line:
args_free(options);

Here is the body of args_free():

void args_free(args_option_t* options)
{
  for (; options->type != ARGS_OPT_END; options++)
  {
    if (options->type == ARGS_OPT_STRING && options->value != NULL)
    {
      free(options->value);
    }
  }
}

If options->type is ARGS_OPT_STRING , options->value will point to an array of pointer "ext_vars":
static char* ext_vars[MAX_ARGS_EXT_VAR + 1];

so there may be leaks?

@z16166 z16166 added the bug label Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant