diff --git a/CHANGELOG.md b/CHANGELOG.md index 551b260fc..096beb586 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed ### Fixed +- Add NULL check in nvts_feed_version_epoch [#768](https://github.com/greenbone/gvmd/pull/768) ### Removed diff --git a/src/manage_sql_nvts.c b/src/manage_sql_nvts.c index d2bb53f30..08cc72d89 100644 --- a/src/manage_sql_nvts.c +++ b/src/manage_sql_nvts.c @@ -169,10 +169,19 @@ nvts_feed_version () time_t nvts_feed_version_epoch () { + gchar *feed_version; struct tm tm; + feed_version = nvts_feed_version (); + + if (feed_version == NULL) + return 0; + memset (&tm, 0, sizeof (struct tm)); - strptime (nvts_feed_version (), "%Y%m%d%H%M%S", &tm); + strptime (feed_version, "%Y%m%d%H%M%S", &tm); + + g_free (feed_version); + return mktime (&tm); }