Skip to content

Commit

Permalink
Move openvasd_start_scan warning up in case the cJSON err is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmundell authored and bjoernricks committed Jan 15, 2025
1 parent 2f06a9a commit b5bb646
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openvasd/openvasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,7 @@ openvasd_start_scan (openvasd_connector_t conn, gchar *data)
if (!parser)
{
const gchar *error_ptr = cJSON_GetErrorPtr ();
g_warning ("%s: Error parsing json string to get the scan ID", __func__);
if (error_ptr != NULL)
{
response->body = g_strdup_printf ("{\"error\": \"%s\"}", error_ptr);
Expand All @@ -819,7 +820,6 @@ openvasd_start_scan (openvasd_connector_t conn, gchar *data)
{
response->body = g_strdup (
"{\"error\": \"Parsing json string to get the scan ID\"}");
g_warning ("%s: Parsing json string to get the scan ID", __func__);
}
response->code = RESP_CODE_ERR;
cJSON_Delete (parser);
Expand Down

0 comments on commit b5bb646

Please sign in to comment.