mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 08:46:45 +00:00
Added ScriptResult class change in order to avoid managing string memory
created via strdup(). Script output and id (strings) are now C++ std::string.
This commit is contained in:
parent
f9e6d7d01a
commit
13452505a5
6 changed files with 53 additions and 36 deletions
15
nse_main.h
15
nse_main.h
|
|
@ -13,12 +13,19 @@ extern "C" {
|
|||
#include <string.h>
|
||||
#include <iostream>
|
||||
|
||||
struct script_scan_result {
|
||||
char* id;
|
||||
char* output;
|
||||
class ScriptResult
|
||||
{
|
||||
private:
|
||||
std::string output;
|
||||
std::string id;
|
||||
public:
|
||||
void set_output (const char *);
|
||||
std::string get_output (void);
|
||||
void set_id (const char *);
|
||||
std::string get_id (void);
|
||||
};
|
||||
|
||||
typedef std::vector<struct script_scan_result> ScriptResults;
|
||||
typedef std::vector<ScriptResult> ScriptResults;
|
||||
|
||||
class Target;
|
||||
int script_scan(std::vector<Target *> &targets);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue