From f4b985d165e20bcc3678de76755b11d8ad9e7456 Mon Sep 17 00:00:00 2001 From: Daniel Caujolle-Bert Date: Sat, 7 Jun 2025 17:37:17 +0200 Subject: [PATCH] Fix nullptr instead of NULL argument usage in getaddrinfo(). Bump version. --- DGIdGateway/UDPSocket.cpp | 2 +- DGIdGateway/Version.h | 2 +- YSFGateway/UDPSocket.cpp | 2 +- YSFGateway/Version.h | 2 +- YSFParrot/UDPSocket.cpp | 2 +- YSFParrot/Version.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/DGIdGateway/UDPSocket.cpp b/DGIdGateway/UDPSocket.cpp index 63a7ab7..b318677 100644 --- a/DGIdGateway/UDPSocket.cpp +++ b/DGIdGateway/UDPSocket.cpp @@ -94,7 +94,7 @@ int CUDPSocket::lookup(const std::string& hostname, unsigned short port, sockadd /* Port is always digits, no needs to lookup service */ hints.ai_flags |= AI_NUMERICSERV; - int err = ::getaddrinfo(hostname.empty() ? nullptr : hostname.c_str(), portstr.c_str(), &hints, &res); + int err = ::getaddrinfo(hostname.empty() ? NULL : hostname.c_str(), portstr.c_str(), &hints, &res); if (err != 0) { sockaddr_in* paddr = (sockaddr_in*)&addr; ::memset(paddr, 0x00U, address_length = sizeof(sockaddr_in)); diff --git a/DGIdGateway/Version.h b/DGIdGateway/Version.h index 13f194e..7b0968f 100644 --- a/DGIdGateway/Version.h +++ b/DGIdGateway/Version.h @@ -19,6 +19,6 @@ #if !defined(VERSION_H) #define VERSION_H -const char* VERSION = "20250319"; +const char* VERSION = "20250607"; #endif diff --git a/YSFGateway/UDPSocket.cpp b/YSFGateway/UDPSocket.cpp index 27101fa..47a0774 100644 --- a/YSFGateway/UDPSocket.cpp +++ b/YSFGateway/UDPSocket.cpp @@ -94,7 +94,7 @@ int CUDPSocket::lookup(const std::string& hostname, unsigned short port, sockadd /* Port is always digits, no needs to lookup service */ hints.ai_flags |= AI_NUMERICSERV; - int err = ::getaddrinfo(hostname.empty() ? nullptr : hostname.c_str(), portstr.c_str(), &hints, &res); + int err = ::getaddrinfo(hostname.empty() ? NULL : hostname.c_str(), portstr.c_str(), &hints, &res); if (err != 0) { sockaddr_in* paddr = (sockaddr_in*)&addr; ::memset(paddr, 0x00U, address_length = sizeof(sockaddr_in)); diff --git a/YSFGateway/Version.h b/YSFGateway/Version.h index 13f194e..7b0968f 100644 --- a/YSFGateway/Version.h +++ b/YSFGateway/Version.h @@ -19,6 +19,6 @@ #if !defined(VERSION_H) #define VERSION_H -const char* VERSION = "20250319"; +const char* VERSION = "20250607"; #endif diff --git a/YSFParrot/UDPSocket.cpp b/YSFParrot/UDPSocket.cpp index 27101fa..47a0774 100644 --- a/YSFParrot/UDPSocket.cpp +++ b/YSFParrot/UDPSocket.cpp @@ -94,7 +94,7 @@ int CUDPSocket::lookup(const std::string& hostname, unsigned short port, sockadd /* Port is always digits, no needs to lookup service */ hints.ai_flags |= AI_NUMERICSERV; - int err = ::getaddrinfo(hostname.empty() ? nullptr : hostname.c_str(), portstr.c_str(), &hints, &res); + int err = ::getaddrinfo(hostname.empty() ? NULL : hostname.c_str(), portstr.c_str(), &hints, &res); if (err != 0) { sockaddr_in* paddr = (sockaddr_in*)&addr; ::memset(paddr, 0x00U, address_length = sizeof(sockaddr_in)); diff --git a/YSFParrot/Version.h b/YSFParrot/Version.h index 74da99d..206de5f 100644 --- a/YSFParrot/Version.h +++ b/YSFParrot/Version.h @@ -19,6 +19,6 @@ #if !defined(VERSION_H) #define VERSION_H -const char* VERSION = "20250319"; +const char* VERSION = "20250607"; #endif