Skip to content

Commit 40362f4

Browse files
ozgentimopollmeier
authored andcommitted
Fix: Fix ports and host details in openvasd results
1 parent 962f2e2 commit 40362f4

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

src/manage_sql.c

+17-11
Original file line numberDiff line numberDiff line change
@@ -60110,25 +60110,31 @@ add_openvasd_result_to_report (openvasd_result_t res, gpointer *results_aux)
6011060110
res->detail_value && *res->detail_value)
6011160111
port = g_strdup ("general/Host_Details");
6011260112
else if (res->port > 0)
60113-
{
60114-
char buf[6];
60115-
snprintf(buf, sizeof(buf) , "%d", res->port);
60116-
port = g_strdup (buf);
60117-
}
60113+
port = g_strdup_printf ("%d/%s", res->port, res->protocol);
60114+
else
60115+
port = g_strdup_printf ("general/%s", res->protocol);
6011860116

6011960117
/* Add report host if it doesn't exist. */
6012060118
manage_report_host_add (rep_aux->report, host, 0, 0);
6012160119
if (!strcmp (type, "host_detail"))
6012260120
{
6012360121
gchar *hash_value = NULL;
60124-
if (!check_host_detail_exists (rep_aux->report, host, "openvasd", "",
60125-
"openvasd Host Detail", res->detail_name,
60126-
res->detail_value, &hash_value,
60122+
if (!check_host_detail_exists (rep_aux->report, host,
60123+
res->detail_source_type,
60124+
res->detail_source_name,
60125+
res->detail_source_description,
60126+
res->detail_name,
60127+
res->detail_value,
60128+
&hash_value,
6012760129
rep_aux->hash_hostdetails))
6012860130
{
60129-
insert_report_host_detail (rep_aux->report, host, "openvasd", "",
60130-
"openvasd Host Detail", res->detail_name,
60131-
res->detail_value, hash_value);
60131+
insert_report_host_detail (rep_aux->report, host,
60132+
res->detail_source_type,
60133+
res->detail_source_name,
60134+
res->detail_source_description,
60135+
res->detail_name,
60136+
res->detail_value,
60137+
hash_value);
6013260138
}
6013360139
desc = res->message;
6013460140
g_free (hash_value);

0 commit comments

Comments
 (0)