Commit Graph

164 Commits

Author SHA1 Message Date
nnposter 96dcf4e9ed Remove various "the the" repeats. Closes #2804 2024-03-16 01:16:34 +00:00
dmiller f999182d0f Bump date and reapply header templates 2024-02-28 18:46:45 +00:00
dmiller 6959060fe6 Remove unused checks for OpenSSL from nbase 2023-10-30 19:01:08 +00:00
dmiller ef71e5e37d Avoid out-of-bounds read leading to runaway allocations. Fixes #2731 2023-10-30 19:01:07 +00:00
dmiller 6f6b2de214 Apply new license templates, bump copyright date 2023-04-14 17:11:46 +00:00
dmiller 7fe3f15eca Rewrite C99-style for loops 2023-04-03 21:42:37 +00:00
dmiller ad9d7b7a1b Fix MSVC warning about (void) 2023-01-05 23:45:56 +00:00
dmiller 350d9a23f7 Silence compiler warnings about returning value from void function. Fixes #2529 2022-09-30 20:27:02 +00:00
dmiller ed19887f41 More efficiently check if any non-stdin fds are in the call to select on Windows 2022-09-23 21:42:00 +00:00
dmiller 8dbefeba86 Don't wait around if STDIN has data. Closes #2426 2022-09-23 21:41:59 +00:00
dmiller 6fd0261731 Also check fd_set operations on Windows. Fixes #455 2022-09-23 01:35:09 +00:00
dmiller e9f3b12e07 Move a useful function to nbase 2022-09-20 23:37:25 +00:00
dmiller 8d5b6f3388 Enable DTLS for windows builds 2022-08-29 17:10:23 +00:00
dmiller dd690b3e0b Bump copyright date and update some links [ci skip] 2022-02-18 17:38:46 +00:00
fyodor 3aec3f3a07 Update to latest copyright templates. Main change is that Insecure.Com LLC is now Nmap Software LLC 2021-11-23 16:04:37 +00:00
dmiller 2181443b63 Address a few code analysis warnings: uninitialized vars and undefined behavior 2021-08-06 16:17:46 +00:00
dmiller 1820469f5a Bump supported Windows to Win7 (drop Vista) and update a deprecated API 2021-07-29 21:09:44 +00:00
dmiller 95d98fe6ae Linker optimizations for all projects (Windows) 2021-07-22 17:19:53 +00:00
dmiller 5707fb14c5 Upgrade to VS 2019 2021-07-19 23:58:02 +00:00
dmiller 68d2c0e960 Use stack for global special value so we don't have to clean it up. 2021-04-27 19:22:10 +00:00
dmiller c9b7c2f590 Moar const 2021-04-26 17:58:01 +00:00
nnposter 004c8627c1 Do not override snprintf in VS 2015 and newer
MSVC preprocessor triggers #error in <stdio.h> if redefined

From MS doc:
Beginning with the UCRT in Visual Studio 2015 and Windows 10, snprintf is
no longer identical to _snprintf. The snprintf function behavior is now C99
standard compliant.

Closes #2255
2021-04-16 02:33:39 +00:00
dmiller 05faa0287a Fix addrset matching with overlapping CIDR specs. Fixes #2257 2021-03-01 18:42:00 +00:00
dmiller ef8213a36c Reintegrate Nmap 7.90 release branch 2020-10-05 23:00:30 +00:00
dmiller 8e65c92264 Pass error along instead of printing (link error) 2020-09-02 17:05:55 +00:00
dmiller 083475eb6f Use larger buffer size for socket errors (WSAETIMEDOUT was longer). 2020-08-31 21:11:00 +00:00
dmiller b1620387ba Add thread-safe gmtime equivalent to nbase 2020-01-19 16:37:37 +00:00
dmiller 8f3364a441 Remove more vestiges of Windows raw socket quirks 2020-01-16 19:12:57 +00:00
dmiller 3c7f2de01b Properly return negative on error from vsnprintf
Our implementation of vsnprintf for systems where it is missing did not
correctly return a negative value on error, instead returning the size
passed in. We got this code from tcpdump/libpcap, and it was wrong
there, too, though their latest master branch has removed it in favor of
requiring a C99 compiler (C99 guarantees vsnprintf).

This should remove a LGTM code analysis finding (See #1834) of
cpp/constant-comparison in Ncat because we were checking for a negative
return from Snprintf, which would never occur.
2019-12-29 05:53:27 +00:00
dmiller bf9b61ad22 Fix comment style for LGTM alert suppression 2019-12-22 14:32:04 +00:00
dmiller e356ad1123 Add thread-safe wrapper for ctime. 2019-12-20 20:53:32 +00:00
dmiller 20f47dd6f2 Can't use a macro for a declared function (win32) 2019-12-20 20:53:31 +00:00
dmiller 4a1c9424d3 Replace localtime calls with thread-safe alternative. See #1834 2019-12-15 05:05:57 +00:00
dmiller 6844a8134c Call AC_SEARCH_LIBS before AC_CHECK_FUNCS 2019-11-14 16:37:00 +00:00
dmiller 3a744a85c2 Check o.debugging *after* parsing options, otherwise it's always false. 2019-10-30 23:34:34 +00:00
nnposter 9e8852a7c7 Rectify undefined behavior of out-of-range shift op
Fixes #1717, closes #1718
2019-09-03 21:56:31 +00:00
dmiller d639a53088 Bump copyright date in license headers 2019-05-28 21:36:04 +00:00
nnposter 3da2e6a6a6 Silence a GCC warning 2019-02-19 00:24:51 +00:00
nnposter 71eec581a3 Move declaration to the front to improve compiler compatibility 2019-01-13 23:33:49 +00:00
dmiller 38b843558e Change for-loop initial declarations not allowed in C89 2018-11-13 17:32:32 +00:00
dmiller 66eee935a9 Avoid compiler warning about signedness mismatch on VS2013. 2018-11-08 14:52:32 +00:00
dmiller 1345eb247b Use iterative solution instead of tail recursion to avoid stack problems when optimization is off 2018-11-08 04:25:12 +00:00
dmiller 7ea0a8c9ac Make functions static where possible 2018-11-06 15:07:02 +00:00
dmiller 824f9dcb2f Rearrange declarations to put all addrset functions in nbase.h, hide struct addrset internals. 2018-11-01 04:35:00 +00:00
dmiller 27807aadb4 Straighten out some headers and the (struct) addrset type 2018-11-01 04:34:59 +00:00
dmiller c223ec5c36 Remove unused IPv6 support for legacy addrset_elem bit-matching 2018-11-01 04:34:58 +00:00
dmiller 0f916ec3bc Fix an error in common-prefix calculation 2018-10-31 23:44:52 +00:00
dmiller 625884e7dc Support netmasks in addrset trie. Use trie for resolved addresses and CIDR masks. 2018-10-31 20:32:16 +00:00
dmiller 324965d1d2 Use a radix tree (trie) to match exclude addresses
Current exclusions list from --excludefile takes linear time to match
against. Using a trie structure, we can do matching in O(log n) time,
with a hard maximum of 32 comparisons for IPv4 and 128 comparisons for
IPv6. Each node of the trie represents an address prefix that all
subsequent nodes share; matching stops when one is matched exactly or
when the candidate address does not match any prefix of the addresses in
the trie.

For now, only numeric addresses without netmask are supported. We plan
to extend this to addresses with netmasks, including resolved names.
Storing IPv4 ranges and wildcards in this structure would be
prohibitively complex, so the existing linear match method will be used
for those. It is unlikely that any users are using large exclusion lists
of these types of specifications, so performance impact is small.

Potential future features could use the trie structure to implement
custom routing or scope-limiting.

This was a todo list item based on this report:
https://seclists.org/nmap-dev/2012/q4/420
2018-10-31 14:01:34 +00:00
nnposter 973b471c11 Corrects a few issues related to snprintf return values 2018-08-26 02:29:14 +00:00