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: Clean up in update_scap_affected_products, fix CLI option #2361

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/manage_sql_secinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -4088,14 +4088,14 @@ update_scap_affected_products ()
{
iterator_t cves_iter;
GString *cve_ids_buffer;
g_info ("Updating affected products");
int count = 0;

init_iterator(&cves_iter,
"SELECT DISTINCT cve_id FROM scap2.cpe_match_nodes");
g_info ("Updating affected products");

int count = 0;
init_iterator (&cves_iter,
"SELECT DISTINCT cve_id FROM scap2.cpe_match_nodes");

cve_ids_buffer = g_string_new("");
cve_ids_buffer = g_string_new ("");
while (next (&cves_iter))
{
resource_t cve_id;
Expand All @@ -4112,13 +4112,14 @@ update_scap_affected_products ()
g_debug ("%s: Products of %d CVEs processed", __func__, count);
}
}
cleanup_iterator (&cves_iter);

if (cve_ids_buffer->len)
{
exec_affected_products_sql (cve_ids_buffer->str);
g_string_truncate (cve_ids_buffer, 0);
g_debug ("%s: Products of %d CVEs processed", __func__, count);
}
g_free (cve_ids_buffer);

}

Expand Down Expand Up @@ -5842,7 +5843,7 @@ set_affected_products_query_size (int new_size)
if (new_size <= 0)
affected_products_query_size = AFFECTED_PRODUCTS_QUERY_SIZE_DEFAULT;
else
secinfo_commit_size = new_size;
affected_products_query_size = new_size;
}

/**
Expand Down
Loading