Use 1-byte alignment/packing for socks4. Fixes #2595
Some checks are pending
nmap multiplatform autobuilds / build (arm64, gcc, ubuntu-latest-gcc-arm64, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, freebsd-15-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, macos-15-clang, macos-15) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, macos-26-clang, macos-26) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, netbsd-10-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, openbsd-7-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, solaris-11-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, ubuntu-latest-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (egcc, openbsd-7-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (gcc, freebsd-15-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (gcc, netbsd-10-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (gcc, solaris-11-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (gcc, ubuntu-latest-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (msvc, windows-latest-msvc, windows-latest) (push) Waiting to run

This commit is contained in:
dmiller 2026-05-26 01:52:17 +00:00
parent ff028e681f
commit 947f53c079
2 changed files with 6 additions and 0 deletions

View file

@ -1,5 +1,9 @@
#Nmap Changelog ($Id$); -*-text-*-
o [Nsock][GH#2595] Fix an issue where Nsock's SOCKS4 proxy code would send
additional null bytes on Windows and other platforms where the compiler does
not understand __attribute__((packed)). [Daniel Miller]
o The --release-memory option is now a no-op. Nmap will always run finalization
routines that release allocated memory before closing.

View file

@ -64,6 +64,7 @@
extern const struct proxy_spec ProxySpecSocks4;
#pragma pack(push, 1)
struct socks4_data {
uint8_t version;
uint8_t type;
@ -71,6 +72,7 @@ struct socks4_data {
uint32_t address;
uint8_t null;
} __attribute__((packed));
#pragma pack(pop)
static int proxy_socks4_node_new(struct proxy_node **node, const struct uri *uri) {