mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Merging over from /nmap-exp/kris/assert-testing
Ensuring the safety of assert() calls by keeping NDEBUG undefined throughout Nmap, Nbase and Nsock. I've tested this on Linux and Windows XP without problems. On Windows I've removed the definitions of _DEBUG and NDEBUG from the *.vcproj files.
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
# Nmap Changelog ($Id$); -*-text-*-
|
# Nmap Changelog ($Id$); -*-text-*-
|
||||||
|
|
||||||
|
o Since assert() calls are used for various security-related tests,
|
||||||
|
their safety is now ensured by keeping NDEBUG undefined throughout
|
||||||
|
Nmap, Nbase and Nsock. [Kris]
|
||||||
|
|
||||||
Nmap 4.62 [5/3/08]
|
Nmap 4.62 [5/3/08]
|
||||||
|
|
||||||
o Added a new --min-rate option that allows specifying a minimum rate
|
o Added a new --min-rate option that allows specifying a minimum rate
|
||||||
|
|||||||
@@ -102,7 +102,7 @@
|
|||||||
#ifndef NMAPOUTPUTTABLE_H
|
#ifndef NMAPOUTPUTTABLE_H
|
||||||
#define NMAPOUTPUTTABLE_H
|
#define NMAPOUTPUTTABLE_H
|
||||||
|
|
||||||
#include <assert.h>
|
#include "nmap.h"
|
||||||
|
|
||||||
#ifndef __attribute__
|
#ifndef __attribute__
|
||||||
#define __attribute__(args)
|
#define __attribute__(args)
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="include;"..\mswin32\pcap-include""
|
AdditionalIncludeDirectories="include;"..\mswin32\pcap-include""
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
|
PreprocessorDefinitions="WIN32;_LIB"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="1"
|
RuntimeLibrary="1"
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||||
AdditionalIncludeDirectories="include;"..\mswin32\pcap-include""
|
AdditionalIncludeDirectories="include;"..\mswin32\pcap-include""
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
|
PreprocessorDefinitions="WIN32;_LIB"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
UseUnicodeResponseFiles="false"
|
UseUnicodeResponseFiles="false"
|
||||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
|
PreprocessorDefinitions="WIN32;_LIB"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
ExceptionHandling="0"
|
ExceptionHandling="0"
|
||||||
BasicRuntimeChecks="0"
|
BasicRuntimeChecks="0"
|
||||||
@@ -114,7 +114,7 @@
|
|||||||
UseUnicodeResponseFiles="false"
|
UseUnicodeResponseFiles="false"
|
||||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||||
WholeProgramOptimization="false"
|
WholeProgramOptimization="false"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
|
PreprocessorDefinitions="WIN32;_LIB"
|
||||||
MinimalRebuild="false"
|
MinimalRebuild="false"
|
||||||
ExceptionHandling="0"
|
ExceptionHandling="0"
|
||||||
BasicRuntimeChecks="0"
|
BasicRuntimeChecks="0"
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
|
PreprocessorDefinitions="WIN32;_LIB"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="1"
|
RuntimeLibrary="1"
|
||||||
@@ -104,7 +104,7 @@
|
|||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
|
PreprocessorDefinitions="WIN32;_LIB"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="..\liblua;.;..;../nbase;../libpcre;winip;..\nsock\include;"pcap-include";"..\libdnet-stripped\include""
|
AdditionalIncludeDirectories="..\liblua;.;..;../nbase;../libpcre;winip;..\nsock\include;"pcap-include";"..\libdnet-stripped\include""
|
||||||
PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE"
|
PreprocessorDefinitions="WIN32;_CONSOLE"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="1"
|
RuntimeLibrary="1"
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
@@ -61,11 +61,6 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
|
||||||
Name="VCResourceCompilerTool"
|
|
||||||
PreprocessorDefinitions="_DEBUG"
|
|
||||||
Culture="1033"
|
|
||||||
/>
|
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPreLinkEventTool"
|
Name="VCPreLinkEventTool"
|
||||||
/>
|
/>
|
||||||
@@ -142,7 +137,7 @@
|
|||||||
Optimization="2"
|
Optimization="2"
|
||||||
InlineFunctionExpansion="1"
|
InlineFunctionExpansion="1"
|
||||||
AdditionalIncludeDirectories=".;..;../liblua;../nbase;../libpcre;winip;..\nsock\include;"pcap-include";"..\libdnet-stripped\include""
|
AdditionalIncludeDirectories=".;..;../liblua;../nbase;../libpcre;winip;..\nsock\include;"pcap-include";"..\libdnet-stripped\include""
|
||||||
PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE"
|
PreprocessorDefinitions="WIN32;_CONSOLE"
|
||||||
StringPooling="true"
|
StringPooling="true"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
EnableFunctionLevelLinking="true"
|
EnableFunctionLevelLinking="true"
|
||||||
@@ -157,11 +152,6 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
|
||||||
Name="VCResourceCompilerTool"
|
|
||||||
PreprocessorDefinitions="NDEBUG"
|
|
||||||
Culture="1033"
|
|
||||||
/>
|
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPreLinkEventTool"
|
Name="VCPreLinkEventTool"
|
||||||
/>
|
/>
|
||||||
|
|||||||
3
nmap.h
3
nmap.h
@@ -227,6 +227,9 @@ void *realloc();
|
|||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Keep assert() defined for security reasons */
|
||||||
|
#undef NDEBUG
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="..\liblua"
|
AdditionalIncludeDirectories="..\liblua"
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;NSE_BITLIB_EXPORTS;WIN32;LUA_BUILD_AS_DLL;LUA_LIB"
|
PreprocessorDefinitions="WIN32;_WINDOWS;_USRDLL;NSE_BITLIB_EXPORTS;WIN32;LUA_BUILD_AS_DLL;LUA_LIB"
|
||||||
MinimalRebuild="false"
|
MinimalRebuild="false"
|
||||||
ExceptionHandling="0"
|
ExceptionHandling="0"
|
||||||
BasicRuntimeChecks="0"
|
BasicRuntimeChecks="0"
|
||||||
@@ -120,7 +120,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
AdditionalIncludeDirectories="..\liblua"
|
AdditionalIncludeDirectories="..\liblua"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;NSE_BITLIB_EXPORTS;WIN32;LUA_BUILD_AS_DLL;LUA_LIB"
|
PreprocessorDefinitions="WIN32;_WINDOWS;_USRDLL;NSE_BITLIB_EXPORTS;WIN32;LUA_BUILD_AS_DLL;LUA_LIB"
|
||||||
RuntimeLibrary="2"
|
RuntimeLibrary="2"
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
|
|||||||
@@ -132,10 +132,6 @@
|
|||||||
namespace std {};
|
namespace std {};
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
// Because this file uses assert()s for some security checking, we can't
|
|
||||||
// have anyone turning off debugging.
|
|
||||||
#undef NDEBUG
|
|
||||||
|
|
||||||
extern NmapOps o;
|
extern NmapOps o;
|
||||||
|
|
||||||
// Details on a particular service (open port) we are trying to match
|
// Details on a particular service (open port) we are trying to match
|
||||||
|
|||||||
3
utils.h
3
utils.h
@@ -108,6 +108,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include "nmap.h"
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include "mswin32\winclude.h"
|
#include "mswin32\winclude.h"
|
||||||
#else
|
#else
|
||||||
@@ -117,7 +118,6 @@
|
|||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include "nmap_config.h"
|
#include "nmap_config.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -140,7 +140,6 @@
|
|||||||
#include "nbase.h"
|
#include "nbase.h"
|
||||||
|
|
||||||
#include "nmap_error.h"
|
#include "nmap_error.h"
|
||||||
#include "nmap.h"
|
|
||||||
#include "global_structures.h"
|
#include "global_structures.h"
|
||||||
|
|
||||||
/* Arithmatic difference modulo 2^32 */
|
/* Arithmatic difference modulo 2^32 */
|
||||||
|
|||||||
Reference in New Issue
Block a user