Skip to content

Commit

Permalink
Merge pull request #296 from kroosec/scan-missing-nvt-6
Browse files Browse the repository at this point in the history
Fix crash when a plugin is missing during a scan.
  • Loading branch information
jjnicola authored Apr 8, 2019
2 parents 55c53e1 + 6ea996e commit 504a242
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/attack.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,14 @@ launch_plugin (struct scan_globals *globals, struct scheduler_plugin *plugin,
addr6_to_str (ip, ip_str);
oid = plugin->oid;
nvti = nvticache_get_nvt (oid);

/* eg. When NVT was moved/removed by a feed update during the scan. */
if (!nvti)
{
g_message ("Plugin '%s' missing from nvticache.", oid);
plugin->running_state = PLUGIN_STATUS_DONE;
goto finish_launch_plugin;
}
if (scan_is_stopped () || all_scans_are_stopped ())
{
if (nvti->category != ACT_END)
Expand Down
2 changes: 1 addition & 1 deletion src/pluginscheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ plugin_add (plugins_scheduler_t sched, GHashTable *oids_table,
{
char *name = nvticache_get_filename (oid);
g_message ("Plugin %s is deprecated. "
"It will neither loaded nor launched.",
"It will neither be loaded nor launched.",
name);
g_free (name);
}
Expand Down

0 comments on commit 504a242

Please sign in to comment.