diff --git a/CHANGELOG.md b/CHANGELOG.md index 33a008792..fb4c159b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -87,6 +87,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Put 'lean' back to 0 for GET_RESULTS [#1001](https://github.com/greenbone/gvmd/pull/1001) - Improve handling of removed NVT prefs [#1003](https://github.com/greenbone/gvmd/pull/1003) - Ensure parent exists when moving report format dir [#1019](https://github.com/greenbone/gvmd/pull/1019) +- Use nvti_qod instead of the old nvti_get_tag() [#1022](https://github.com/greenbone/gvmd/pull/1022) ### Removed - Remove support for "All SecInfo": removal of "allinfo" for type in get_info [#790](https://github.com/greenbone/gvmd/pull/790) diff --git a/src/manage_sql_nvts.c b/src/manage_sql_nvts.c index ef9b86b1a..8a9112621 100644 --- a/src/manage_sql_nvts.c +++ b/src/manage_sql_nvts.c @@ -296,7 +296,7 @@ insert_nvt (const nvti_t *nvti) quoted_cvss_base = sql_quote (nvti_cvss_base (nvti) ? nvti_cvss_base (nvti) : ""); - qod_str = nvti_get_tag (nvti, "qod"); + qod_str = nvti_qod (nvti); qod_type = nvti_qod_type (nvti); if (qod_str == NULL || sscanf (qod_str, "%d", &qod) != 1) @@ -304,8 +304,6 @@ insert_nvt (const nvti_t *nvti) quoted_qod_type = sql_quote (qod_type ? qod_type : ""); - g_free (qod_str); - quoted_family = sql_quote (nvti_family (nvti) ? nvti_family (nvti) : ""); if (sql_int ("SELECT EXISTS (SELECT * FROM nvts WHERE oid = '%s');", @@ -1238,8 +1236,15 @@ nvti_from_vt (entity_t vt) detection = entity_child (vt, "detection"); if (detection) { + const gchar *qod; + nvti_set_detection (nvti, entity_text (detection)); - nvti_set_qod_type (nvti, entity_attribute (detection, "qod_type")); + + qod = entity_attribute (detection, "qod"); + if (qod == NULL) + nvti_set_qod_type (nvti, entity_attribute (detection, "qod_type")); + else + nvti_set_qod (nvti, qod); } solution = entity_child (vt, "solution");