Skip to content

Commit

Permalink
Merge pull request #768 from mattmundell/feed-version-null
Browse files Browse the repository at this point in the history
Add NULL check in nvts_feed_version_epoch
  • Loading branch information
timopollmeier authored Oct 2, 2019
2 parents fbe3390 + b952548 commit 1fa6f3f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 10 additions & 1 deletion src/manage_sql_nvts.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 1fa6f3f

Please sign in to comment.