Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package miniupnpc for openSUSE:Factory checked in at 2026-11-26 15:54:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/miniupnpc (Old) and /work/SRC/openSUSE:Factory/.miniupnpc.new.1340718 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "miniupnpc" Thu Nov 26 15:54:05 2026 rev:28 rq:1400636 version:2.3.5 Changes: -------- --- /work/SRC/openSUSE:Factory/miniupnpc/miniupnpc.changes 2026-04-01 19:52:25.805618897 +0200 +++ /work/SRC/openSUSE:Factory/.miniupnpc.new.1340718/miniupnpc.changes 2026-11-26 15:54:43.797119742 +0100 @@ -1,0 +2,12 @@ +Mon Nov 23 19:44:45 UTC 2026 - Martin Hauke <[email protected]> + +- Update to version 2.3.5 + * there was a packaging error with miniupnpc-2.3.4.tar.gz. +- Update to version 2.3.4 + * minissdpc.c: fix deduping of devices. + * support C23 / glibc 2.43 strstr/strchr returning const char * . + * fix: build_absolute_url if if_indextoname() returns NULL. + * Use `poll()` where possible + Fix `FD_SET` crash bug. + * fix build with C++ compilers. + +------------------------------------------------------------------- Old: ---- miniupnpc-2.3.3.tar.gz miniupnpc-2.3.3.tar.gz.sig New: ---- miniupnpc-2.3.5.tar.gz miniupnpc-2.3.5.tar.gz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ miniupnpc.spec ++++++ --- /var/tmp/diff_new_pack.bTwpL5/_old 2026-11-26 15:54:44.721158845 +0100 +++ /var/tmp/diff_new_pack.bTwpL5/_new 2026-11-26 15:54:44.727159099 +0100 @@ -18,7 +18,7 @@ %define soname 21 Name: miniupnpc -Version: 2.3.3 +Version: 2.3.5 Release: 0 Summary: Universal Plug'n'Play (UPnP) Client License: BSD-3-Clause ++++++ miniupnpc-2.3.3.tar.gz -> miniupnpc-2.3.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/CMakeLists.txt new/miniupnpc-2.3.5/CMakeLists.txt --- old/miniupnpc-2.3.3/CMakeLists.txt 2025-05-27 00:55:55.000000000 +0200 +++ new/miniupnpc-2.3.5/CMakeLists.txt 2026-11-16 23:00:56.000000000 +0100 @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.14 FATAL_ERROR) project (miniupnpc - VERSION 2.3.3 + VERSION 2.3.5 DESCRIPTION "UPnP IGD client lightweight library" HOMEPAGE_URL https://miniupnp.tuxfamily.org/ LANGUAGES C) @@ -33,7 +33,7 @@ MINIUPNPC_SET_SOCKET_TIMEOUT MINIUPNPC_GET_SRC_ADDR _BSD_SOURCE _DEFAULT_SOURCE) - if (NOT APPLE AND NOT CMAKE_SYSTEM_NAME MATCHES ".*BSD" AND NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS") + if (NOT APPLE AND NOT CMAKE_SYSTEM_NAME MATCHES ".*BSD" AND NOT CMAKE_SYSTEM_NAME STREQUAL "DragonFly" AND NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS") # add_definitions (-D_POSIX_C_SOURCE=200112L) target_compile_definitions(miniupnpc-private INTERFACE _XOPEN_SOURCE=600) endif () diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/Changelog.txt new/miniupnpc-2.3.5/Changelog.txt --- old/miniupnpc-2.3.3/Changelog.txt 2025-05-27 00:55:32.000000000 +0200 +++ new/miniupnpc-2.3.5/Changelog.txt 2026-11-16 22:59:56.000000000 +0100 @@ -1,6 +1,33 @@ -$Id: Changelog.txt,v 1.280 2025/05/25 21:56:47 nanard Exp $ +$Id: Changelog.txt,v 1.281 2025/05/26 22:56:38 nanard Exp $ miniUPnP client Changelog. +VERSION 2.3.5 : released 2026/11/16 + there was a packaging error with miniupnpc-2.3.4.tar.gz + +VERSION 2.3.4 : released 2026/11/15 + +2026/08/30: + minissdpc.c: fix deduping of devices + +2026/05/14: + fix build with cmake under DragonFly BSD + +2026/04/04: + support C23 / glibc 2.43 strstr/strchr returning const char * + +2026/03/24: + fix: build_absolute_url if if_indextoname() returns NULL + +2026/02/05: + dllwrap is deprecated : use gcc -shared for DLL build + +2025/11/29: + Fix Windows socket timeout handling in connecthostport.c + Use `poll()` where possible + Fix `FD_SET` crash bug + +2025/07/07: + fix build with C++ compilers + VERSION 2.3.3 : released 2025/05/27 2025/05/25: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/Doxyfile new/miniupnpc-2.3.5/Doxyfile --- old/miniupnpc-2.3.3/Doxyfile 2025-05-27 00:55:57.000000000 +0200 +++ new/miniupnpc-2.3.5/Doxyfile 2026-11-16 23:00:56.000000000 +0100 @@ -48,7 +48,7 @@ # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 2.3.3 +PROJECT_NUMBER = 2.3.5 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/LICENSE new/miniupnpc-2.3.5/LICENSE --- old/miniupnpc-2.3.3/LICENSE 2025-02-23 17:39:46.000000000 +0100 +++ new/miniupnpc-2.3.5/LICENSE 2026-02-05 23:45:32.000000000 +0100 @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2005-2025, Thomas BERNARD +Copyright (c) 2005-2026, Thomas BERNARD All rights reserved. Redistribution and use in source and binary forms, with or without diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/Makefile new/miniupnpc-2.3.5/Makefile --- old/miniupnpc-2.3.3/Makefile 2025-04-03 23:19:31.000000000 +0200 +++ new/miniupnpc-2.3.5/Makefile 2026-11-16 22:53:08.000000000 +0100 @@ -248,7 +248,7 @@ updateversion: include/miniupnpc.h cp $< $<.bak - sed 's/\(.*MINIUPNPC_API_VERSION\s\+\)[0-9]\+/\1$(APIVERSION)/' < $<.bak > $< + sed 's/\(.*MINIUPNPC_API_VERSION.\)[0-9]*/\1$(APIVERSION)/' < $<.bak > $< install: updateversion $(FILESTOINSTALL) $(INSTALL) -d $(DESTDIR)$(INSTALLDIRINC) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/Makefile.mingw new/miniupnpc-2.3.5/Makefile.mingw --- old/miniupnpc-2.3.3/Makefile.mingw 2024-06-09 00:09:36.000000000 +0200 +++ new/miniupnpc-2.3.5/Makefile.mingw 2026-02-05 23:32:55.000000000 +0100 @@ -1,12 +1,14 @@ -# $Id: Makefile.mingw,v 1.37 2024/05/16 00:10:25 nanard Exp $ +# $Id: Makefile.mingw,v 1.36 2024/01/04 01:29:56 nanard Exp $ # Miniupnp project. # http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ -# (c) 2005-2024 Thomas Bernard +# (c) 2005-2026 Thomas Bernard # This Makefile is made for MinGW # # To cross compile on a *nix machine : # make -f Makefile.mingw DLLWRAP=mingw32-dllwrap CC=mingw32-gcc AR=mingw32-ar WINDRES=mingw32-windres # +# set USE_DLLWRAP=1 to use dllwrap instead of gcc -shared +# SRCDIR = src INCDIR = include @@ -90,11 +92,18 @@ $(PYTHON) setupmingw32.py bdist_wheel --skip-build miniupnpc.dll: miniupnpc.def $(OBJSDLL) +ifeq ($(USE_DLLWRAP),1) $(DLLWRAP) -k --driver-name $(CC) \ --def miniupnpc.def \ --output-def miniupnpc.dll.def \ --implib miniupnpc.lib -o $@ \ $(OBJSDLL) $(LDLIBS) +else + $(CC) -shared -o $@ $(OBJSDLL) $(LDLIBS) \ + -Wl,--output-def,miniupnpc.dll.def \ + -Wl,--out-implib,miniupnpc.lib \ + miniupnpc.def +endif miniupnpc.lib: miniupnpc.dll diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/README new/miniupnpc-2.3.5/README --- old/miniupnpc-2.3.3/README 2025-02-23 17:39:46.000000000 +0100 +++ new/miniupnpc-2.3.5/README 2026-02-05 23:46:04.000000000 +0100 @@ -2,7 +2,7 @@ Project web page: http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ github: https://github.com/miniupnp/miniupnp Author: Thomas Bernard -Copyright (c) 2005-2025 Thomas Bernard +Copyright (c) 2005-2026 Thomas Bernard This software is subject to the conditions detailed in the LICENSE file provided within this distribution. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/VERSION new/miniupnpc-2.3.5/VERSION --- old/miniupnpc-2.3.3/VERSION 2025-05-27 00:55:39.000000000 +0200 +++ new/miniupnpc-2.3.5/VERSION 2026-11-16 23:00:55.000000000 +0100 @@ -1 +1 @@ -2.3.3 +2.3.5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/external-ip.sh new/miniupnpc-2.3.5/external-ip.sh --- old/miniupnpc-2.3.3/external-ip.sh 2017-11-02 18:38:01.000000000 +0100 +++ new/miniupnpc-2.3.5/external-ip.sh 2017-11-02 18:08:36.000000000 +0100 @@ -1,4 +1,4 @@ #!/bin/sh -# $Id: external-ip.sh,v 1.2 2017/11/02 15:33:09 nanard Exp $ +# $Id: external-ip.sh,v 1.1 2010/08/05 12:57:41 nanard Exp $ # (c) 2010 Reuben Hawkins upnpc -s | sed -n -e 's/^ExternalIPAddress = \([0-9.]*\)$/\1/p' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/include/miniupnpc.h new/miniupnpc-2.3.5/include/miniupnpc.h --- old/miniupnpc-2.3.3/include/miniupnpc.h 2025-05-27 00:55:55.000000000 +0200 +++ new/miniupnpc-2.3.5/include/miniupnpc.h 2026-11-16 23:00:56.000000000 +0100 @@ -1,9 +1,9 @@ -/* $Id: miniupnpc.h,v 1.79 2025/05/25 21:51:11 nanard Exp $ */ +/* $Id: miniupnpc.h,v 1.80 2025/05/26 22:56:40 nanard Exp $ */ /* vim: tabstop=4 shiftwidth=4 noexpandtab * Project: miniupnp * http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ * Author: Thomas Bernard - * Copyright (c) 2005-2025 Thomas Bernard + * Copyright (c) 2005-2026 Thomas Bernard * This software is subjects to the conditions detailed * in the LICENCE file provided within this distribution */ #ifndef MINIUPNPC_H_INCLUDED @@ -42,7 +42,7 @@ #define UPNPDISCOVER_MEMORY_ERROR (-102) /*! \brief software version */ -#define MINIUPNPC_VERSION "2.3.3" +#define MINIUPNPC_VERSION "2.3.5" /*! \brief C API version */ #define MINIUPNPC_API_VERSION 21 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/include/miniupnpctypes.h new/miniupnpc-2.3.5/include/miniupnpctypes.h --- old/miniupnpc-2.3.3/include/miniupnpctypes.h 2025-03-05 11:30:02.000000000 +0100 +++ new/miniupnpc-2.3.5/include/miniupnpctypes.h 2025-03-02 02:21:04.000000000 +0100 @@ -1,4 +1,4 @@ -/* $Id: miniupnpctypes.h,v 1.5 2025/03/02 01:15:44 nanard Exp $ */ +/* $Id: miniupnpctypes.h,v 1.4 2025/02/08 23:15:16 nanard Exp $ */ /* Project: miniupnp * http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org * Author: Thomas Bernard diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/include/miniwget.h new/miniupnpc-2.3.5/include/miniwget.h --- old/miniupnpc-2.3.3/include/miniwget.h 2025-03-05 11:30:02.000000000 +0100 +++ new/miniupnpc-2.3.5/include/miniwget.h 2025-03-02 02:21:04.000000000 +0100 @@ -1,4 +1,4 @@ -/* $Id: miniwget.h,v 1.15 2025/03/02 01:14:38 nanard Exp $ */ +/* $Id: miniwget.h,v 1.14 2025/02/08 23:15:17 nanard Exp $ */ /* Project : miniupnp * Author : Thomas Bernard * http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/include/upnpcommands.h new/miniupnpc-2.3.5/include/upnpcommands.h --- old/miniupnpc-2.3.3/include/upnpcommands.h 2025-04-03 23:19:32.000000000 +0200 +++ new/miniupnpc-2.3.5/include/upnpcommands.h 2025-05-29 00:38:04.000000000 +0200 @@ -21,6 +21,7 @@ * */ +#include <stddef.h> #include "miniupnpc_declspec.h" #include "miniupnpctypes.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/include/upnpdev.h new/miniupnpc-2.3.5/include/upnpdev.h --- old/miniupnpc-2.3.3/include/upnpdev.h 2025-02-23 17:39:47.000000000 +0100 +++ new/miniupnpc-2.3.5/include/upnpdev.h 2025-07-07 01:46:44.000000000 +0200 @@ -36,7 +36,7 @@ /* C99 flexible array member */ /*! \brief buffer for descURL, st and usn */ char buffer[]; -#elif defined(__GNUC__) +#elif defined(__GNUC__) && !defined(__cplusplus) char buffer[0]; #else /* Fallback to a hack */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/setup.py new/miniupnpc-2.3.5/setup.py --- old/miniupnpc-2.3.3/setup.py 2024-06-23 00:28:04.000000000 +0200 +++ new/miniupnpc-2.3.5/setup.py 2024-06-17 01:17:43.000000000 +0200 @@ -1,6 +1,6 @@ #! /usr/bin/env python # vim: tabstop=8 shiftwidth=8 expandtab -# $Id: setup.py,v 1.17 2024/06/22 19:23:20 nanard Exp $ +# $Id: setup.py,v 1.16 2024/01/14 23:48:43 nanard Exp $ # the MiniUPnP Project (c) 2007-2024 Thomas Bernard # https://miniupnp.tuxfamily.org/ or http://miniupnp.free.fr/ # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/setupmingw32.py new/miniupnpc-2.3.5/setupmingw32.py --- old/miniupnpc-2.3.3/setupmingw32.py 2024-06-23 00:28:04.000000000 +0200 +++ new/miniupnpc-2.3.5/setupmingw32.py 2025-02-23 22:09:14.000000000 +0100 @@ -1,6 +1,6 @@ #! /usr/bin/env python # vim: tabstop=8 shiftwidth=8 expandtab -# $Id: setupmingw32.py,v 1.16 2024/06/22 19:23:20 nanard Exp $ +# $Id: setupmingw32.py,v 1.15 2024/01/14 23:48:43 nanard Exp $ # the MiniUPnP Project (c) 2007-2024 Thomas Bernard # https://miniupnp.tuxfamily.org/ or http://miniupnp.free.fr/ # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/addr_is_reserved.c new/miniupnpc-2.3.5/src/addr_is_reserved.c --- old/miniupnpc-2.3.3/src/addr_is_reserved.c 2025-05-27 00:50:38.000000000 +0200 +++ new/miniupnpc-2.3.5/src/addr_is_reserved.c 2026-08-12 01:43:03.000000000 +0200 @@ -1,4 +1,4 @@ -/* $Id: addr_is_reserved.c,v 1.8 2025/05/25 21:56:48 nanard Exp $ */ +/* $Id: addr_is_reserved.c,v 1.7 2025/01/12 15:47:17 nanard Exp $ */ /* vim: tabstop=4 shiftwidth=4 noexpandtab * Project : miniupnp * Web : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ @@ -11,11 +11,11 @@ #define WIN32_LEAN_AND_MEAN #include <winsock2.h> #include <ws2tcpip.h> -#if !defined(_MSC_VER) +#if !defined(_MSC_VER) || (_MSC_VER >= 1600) #include <stdint.h> -#else /* !defined(_MSC_VER) */ +#else /* !defined(_MSC_VER) || (_MSC_VER >= 1600) */ typedef unsigned long uint32_t; -#endif /* !defined(_MSC_VER) */ +#endif /* !defined(_MSC_VER) || (_MSC_VER >= 1600) */ #if !defined(_WIN32_WINNT_VISTA) #define _WIN32_WINNT_VISTA 0x0600 #endif @@ -30,7 +30,7 @@ #endif /* List of IP address blocks which are private / reserved and therefore not suitable for public external IP addresses */ -#define IP(a, b, c, d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d)) +#define IP(a, b, c, d) ((uint32_t)(((a) << 24) + ((b) << 16) + ((c) << 8) + (d))) #define MSK(m) (32-(m)) static const struct { uint32_t address; uint32_t rmask; } reserved[] = { { IP( 0, 0, 0, 0), MSK( 8) }, /* RFC1122 "This host on this network" */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/addr_is_reserved.h new/miniupnpc-2.3.5/src/addr_is_reserved.h --- old/miniupnpc-2.3.3/src/addr_is_reserved.h 2020-09-28 23:11:19.000000000 +0200 +++ new/miniupnpc-2.3.5/src/addr_is_reserved.h 2024-05-13 20:16:47.000000000 +0200 @@ -1,4 +1,4 @@ -/* $Id: addr_is_reserved.h,v 1.1 2020/09/28 21:11:19 nanard Exp $ */ +/* $Id: $ */ /* vim: tabstop=4 shiftwidth=4 noexpandtab * Project: miniupnp * http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/codelength.h new/miniupnpc-2.3.5/src/codelength.h --- old/miniupnpc-2.3.3/src/codelength.h 2015-07-15 18:14:00.000000000 +0200 +++ new/miniupnpc-2.3.5/src/codelength.h 2024-05-13 20:16:47.000000000 +0200 @@ -1,4 +1,4 @@ -/* $Id: codelength.h,v 1.5 2015/07/09 12:40:18 nanard Exp $ */ +/* $Id: codelength.h,v 1.3 2011/07/30 13:10:05 nanard Exp $ */ /* Project : miniupnp * Author : Thomas BERNARD * copyright (c) 2005-2015 Thomas Bernard diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/connecthostport.c new/miniupnpc-2.3.5/src/connecthostport.c --- old/miniupnpc-2.3.3/src/connecthostport.c 2025-05-27 00:50:38.000000000 +0200 +++ new/miniupnpc-2.3.5/src/connecthostport.c 2026-08-12 01:43:03.000000000 +0200 @@ -1,9 +1,9 @@ -/* $Id: connecthostport.c,v 1.26 2025/05/25 21:56:48 nanard Exp $ */ +/* $Id: connecthostport.c,v 1.25 2025/05/24 15:59:08 nanard Exp $ */ /* vim: tabstop=4 shiftwidth=4 noexpandtab * Project : miniupnp * Web : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ * Author : Thomas Bernard - * Copyright (c) 2010-2025 Thomas Bernard + * Copyright (c) 2010-2026 Thomas Bernard * This software is subject to the conditions detailed in the * LICENCE file provided in this distribution. */ @@ -41,6 +41,10 @@ #define MINIUPNPC_IGNORE_EINTR #include <sys/socket.h> #include <sys/select.h> +#if !defined(__amigaos__) && !defined(__amigaos4__) +#define USE_POLL +#include <poll.h> +#endif #endif /* #else _WIN32 */ #if defined(__amigaos__) || defined(__amigaos4__) @@ -49,10 +53,37 @@ #include "connecthostport.h" +#if defined(_WIN32) && defined(MINIUPNPC_IGNORE_EINTR) +#error MINIUPNPC_IGNORE_EINTR cannot be used in Win32 builds +#endif + +#ifndef MINIUPNPC_CONNECT_TIMEOUT_IN_MS +#define MINIUPNPC_CONNECT_TIMEOUT_IN_MS 3000 +#endif + #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 64 #endif +#if defined(MINIUPNPC_IGNORE_EINTR) && !defined(USE_POLL) +/* Returns 0 if not in range, 1 if fd is in range */ +static int is_socket_in_fd_set_range(SOCKET s) +{ +#ifdef _WIN32 + /* WIN32 systems don't need this check */ + (void)s; + return 1; +#else + if (s >= FD_SETSIZE) { + fprintf(stderr, "Socket %d is >= FD_SETSIZE %d\n", + (int)s, (int)FD_SETSIZE); + return 0; + } + return 1; +#endif /* #ifdef _WIN32 */ +} +#endif /* #if defined(MINIUPNPC_SET_SOCKET_TIMEOUT) && !defined(USE_POLL) */ + /* connecthostport() * return a socket connected (TCP) to the host and port * or -1 in case of error */ @@ -71,7 +102,12 @@ struct addrinfo hints; #endif /* #ifdef USE_GETHOSTBYNAME */ #ifdef MINIUPNPC_SET_SOCKET_TIMEOUT - struct timeval timeout; +#ifdef _WIN32 + DWORD timeout = MINIUPNPC_CONNECT_TIMEOUT_IN_MS; /* 3000 ms */ +#else + struct timeval timeout = { MINIUPNPC_CONNECT_TIMEOUT_IN_MS / 1000, + (MINIUPNPC_CONNECT_TIMEOUT_IN_MS % 1000) * 1000 }; /* 3 s */ +#endif #endif /* #ifdef MINIUPNPC_SET_SOCKET_TIMEOUT */ #ifdef USE_GETHOSTBYNAME @@ -91,15 +127,35 @@ } #ifdef MINIUPNPC_SET_SOCKET_TIMEOUT /* setting a 3 seconds timeout for the connect() call */ - timeout.tv_sec = 3; - timeout.tv_usec = 0; +#ifdef _WIN32 + /* https://learn.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-setsockopt + * SO_RCVTIMEO DWORD Sets the timeout, in milliseconds, for blocking + * receive calls. */ + if(setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, (const char *)&timeout, sizeof(timeout)) < 0) +#else + /* from socket(7) : + SO_RCVTIMEO et SO_SNDTIMEO + Specify the receiving or sending timeouts until reporting an error. The + argument is a struct timeval. If an input or output function blocks for + this period of time, and data has been sent or received, the return value + of that function will be the amount of data transferred; if no data has + been transferred and the timeout has been reached, then -1 is returned with + errno set to EAGAIN or EWOULDBLOCK, or EINPROGRESS (for connect(2)) just as + if the socket was specified to be nonblocking. If the timeout is set to + zero (the default), then the operation will never timeout. Timeouts only + have effect for system calls that perform socket I/O (e.g., accept(2), + connect(2), read(2), recvmsg(2), send(2), sendmsg(2)); timeouts have no + effect for select(2), poll(2), epoll_wait(2), and so on. */ if(setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(struct timeval)) < 0) +#endif { PRINT_SOCKET_ERROR("setsockopt SO_RCVTIMEO"); } - timeout.tv_sec = 3; - timeout.tv_usec = 0; +#ifdef _WIN32 + if(setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, (const char *)&timeout, sizeof(timeout)) < 0) +#else if(setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(struct timeval)) < 0) +#endif { PRINT_SOCKET_ERROR("setsockopt SO_SNDTIMEO"); } @@ -114,17 +170,33 @@ while(n < 0 && (errno == EINTR || errno == EINPROGRESS)) { socklen_t len; - fd_set wset; int err; +#ifdef USE_POLL + struct pollfd pfd = {s, POLLOUT, 0}; +#ifdef MINIUPNPC_SET_SOCKET_TIMEOUT + n = poll(&pfd, 1, MINIUPNPC_CONNECT_TIMEOUT_IN_MS); +#else + n = poll(&pfd, 1, -1); +#endif + if(n == 1 && pfd.revents & POLLERR) { + /* error on socket */ + closesocket(s); + return INVALID_SOCKET; + } +#else /* #ifdef USE_POLL */ + fd_set wset; FD_ZERO(&wset); + if(!is_socket_in_fd_set_range(s)) { + closesocket(s); + return INVALID_SOCKET; + } FD_SET(s, &wset); #ifdef MINIUPNPC_SET_SOCKET_TIMEOUT - timeout.tv_sec = 3; - timeout.tv_usec = 0; n = select(s + 1, NULL, &wset, NULL, &timeout); #else n = select(s + 1, NULL, &wset, NULL, NULL); #endif +#endif /* #ifdef USE_POLL */ if(n < 0) { if (errno == EINTR) continue; /* try again */ @@ -212,15 +284,19 @@ } #ifdef MINIUPNPC_SET_SOCKET_TIMEOUT /* setting a 3 seconds timeout for the connect() call */ - timeout.tv_sec = 3; - timeout.tv_usec = 0; +#ifdef _WIN32 + if(setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, (const char *)&timeout, sizeof(timeout)) < 0) +#else if(setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(struct timeval)) < 0) +#endif { PRINT_SOCKET_ERROR("setsockopt"); } - timeout.tv_sec = 3; - timeout.tv_usec = 0; +#ifdef _WIN32 + if(setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, (const char *)&timeout, sizeof(timeout)) < 0) +#else if(setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(struct timeval)) < 0) +#endif { PRINT_SOCKET_ERROR("setsockopt"); } @@ -233,17 +309,34 @@ while(n < 0 && (errno == EINTR || errno == EINPROGRESS)) { socklen_t len; - fd_set wset; int err; +#ifdef USE_POLL + struct pollfd pfd = {s, POLLOUT, 0}; +#ifdef MINIUPNPC_SET_SOCKET_TIMEOUT + n = poll(&pfd, 1, MINIUPNPC_CONNECT_TIMEOUT_IN_MS); +#else + n = poll(&pfd, 1, -1); +#endif + if(n == 1 && pfd.revents & POLLERR) { + /* remote end closed socket */ + n = -2; + fprintf(stderr, "poll: POLLERR on socket\n"); + break; + } +#else /* #ifdef USE_POLL */ + fd_set wset; FD_ZERO(&wset); + if(!is_socket_in_fd_set_range(s)) { + n = -2; + break; + } FD_SET(s, &wset); #ifdef MINIUPNPC_SET_SOCKET_TIMEOUT - timeout.tv_sec = 3; - timeout.tv_usec = 0; n = select(s + 1, NULL, &wset, NULL, &timeout); #else n = select(s + 1, NULL, &wset, NULL, NULL); #endif +#endif /* #ifdef USE_POLL */ if(n < 0) { if (errno == EINTR) continue; /* try again */ @@ -281,7 +374,8 @@ } if(n < 0) { - PRINT_SOCKET_ERROR("connect"); + if(n != -2) + PRINT_SOCKET_ERROR("connect"); closesocket(s); return INVALID_SOCKET; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/connecthostport.h new/miniupnpc-2.3.5/src/connecthostport.h --- old/miniupnpc-2.3.3/src/connecthostport.h 2018-04-06 12:53:30.000000000 +0200 +++ new/miniupnpc-2.3.5/src/connecthostport.h 2024-05-13 20:16:47.000000000 +0200 @@ -1,4 +1,4 @@ -/* $Id: connecthostport.h,v 1.4 2018/04/06 10:53:13 nanard Exp $ */ +/* $Id: connecthostport.h,v 1.2 2012/06/23 22:32:33 nanard Exp $ */ /* Project: miniupnp * http://miniupnp.free.fr/ * Author: Thomas Bernard diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/listdevices.c new/miniupnpc-2.3.5/src/listdevices.c --- old/miniupnpc-2.3.3/src/listdevices.c 2024-03-02 12:03:18.000000000 +0100 +++ new/miniupnpc-2.3.5/src/listdevices.c 2024-05-13 20:16:47.000000000 +0200 @@ -1,4 +1,4 @@ -/* $Id: listdevices.c,v 1.9 2024/01/26 23:30:47 nanard Exp $ */ +/* $Id: listdevices.c,v 1.6 2015/07/23 20:40:08 nanard Exp $ */ /* Project : miniupnp * Author : Thomas Bernard * Copyright (c) 2013-2015 Thomas Bernard diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/minisoap.c new/miniupnpc-2.3.5/src/minisoap.c --- old/miniupnpc-2.3.3/src/minisoap.c 2025-05-27 00:50:39.000000000 +0200 +++ new/miniupnpc-2.3.5/src/minisoap.c 2025-05-26 00:10:20.000000000 +0200 @@ -1,4 +1,4 @@ -/* $Id: minisoap.c,v 1.36 2025/05/25 21:56:48 nanard Exp $ */ +/* $Id: minisoap.c,v 1.35 2025/04/27 21:13:45 nanard Exp $ */ /* vim: tabstop=4 shiftwidth=4 noexpandtab * Project : miniupnp * Author : Thomas Bernard diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/minisoap.h new/miniupnpc-2.3.5/src/minisoap.h --- old/miniupnpc-2.3.3/src/minisoap.h 2018-04-06 12:53:30.000000000 +0200 +++ new/miniupnpc-2.3.5/src/minisoap.h 2024-05-13 20:16:47.000000000 +0200 @@ -1,4 +1,4 @@ -/* $Id: minisoap.h,v 1.6 2018/04/06 10:53:13 nanard Exp $ */ +/* $Id: minisoap.h,v 1.4 2010/04/12 20:39:41 nanard Exp $ */ /* Project : miniupnp * Author : Thomas Bernard * Copyright (c) 2005-2018 Thomas Bernard diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/minissdpc.c new/miniupnpc-2.3.5/src/minissdpc.c --- old/miniupnpc-2.3.3/src/minissdpc.c 2025-05-27 00:50:39.000000000 +0200 +++ new/miniupnpc-2.3.5/src/minissdpc.c 2026-09-12 01:39:32.000000000 +0200 @@ -1,9 +1,9 @@ -/* $Id: minissdpc.c,v 1.56 2025/05/25 21:56:48 nanard Exp $ */ +/* $Id: minissdpc.c,v 1.54 2025/03/29 17:59:01 nanard Exp $ */ /* vim: tabstop=4 shiftwidth=4 noexpandtab * Project : miniupnp * Web : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ * Author : Thomas BERNARD - * copyright (c) 2005-2025 Thomas Bernard + * copyright (c) 2005-2026 Thomas Bernard * This software is subjet to the conditions detailed in the * provided LICENCE file. */ #include <stdio.h> @@ -698,7 +698,7 @@ if(error) *error = MINISSDPC_SOCKET_ERROR; PRINT_SOCKET_ERROR("setsockopt(SO_REUSEADDR,...)"); - goto error; + goto close_and_return; } if(ipv6) { @@ -737,7 +737,7 @@ if(error) *error = MINISSDPC_INVALID_INPUT; fprintf(stderr, "Invalid multicast interface name %s\n", multicastif); - goto error; + goto close_and_return; } if(setsockopt(sudp, IPPROTO_IPV6, IPV6_MULTICAST_IF, &ifindex, sizeof(ifindex)) < 0) { @@ -782,7 +782,7 @@ if(ioctl(sudp, SIOCGIFADDR, &ifr, &ifrlen) < 0) { PRINT_SOCKET_ERROR("ioctl(...SIOCGIFADDR...)"); - goto error; + goto close_and_return; } mc_if.s_addr = ((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr; #ifdef HAS_IP_MREQN @@ -794,7 +794,7 @@ if(error) *error = MINISSDPC_INVALID_INPUT; fprintf(stderr, "Invalid multicast ip address / interface name %s\n", multicastif); - goto error; + goto close_and_return; } if(setsockopt(sudp, IPPROTO_IP, IP_MULTICAST_IF, (const char *)&reqn, sizeof(reqn)) < 0) { @@ -823,8 +823,7 @@ if(error) *error = MINISSDPC_SOCKET_ERROR; PRINT_SOCKET_ERROR("bind"); - closesocket(sudp); - return NULL; + goto close_and_return; } if(error) @@ -848,7 +847,7 @@ if ((unsigned int)n >= sizeof(bufr)) { if(error) *error = MINISSDPC_MEMORY_ERROR; - goto error; + goto close_and_return; } #ifdef DEBUG /*printf("Sending %s", bufr);*/ @@ -940,7 +939,7 @@ /* error */ if(error) *error = MINISSDPC_SOCKET_ERROR; - goto error; + goto close_and_return; } else if (n == 0) { /* no data or Time Out */ #ifdef DEBUG @@ -950,7 +949,7 @@ /* found some devices, stop now*/ if(error) *error = MINISSDPC_SUCCESS; - goto error; + goto close_and_return; } } else { const char * descURL=NULL; @@ -967,11 +966,11 @@ #endif /* DEBUG */ for(tmp=devlist; tmp; tmp = tmp->pNext) { if(strncmp(tmp->descURL, descURL, urlsize) == 0 && - tmp->descURL[urlsize] == '\0' && + (int)strlen(tmp->descURL) == urlsize && strncmp(tmp->st, st, stsize) == 0 && - tmp->st[stsize] == '\0' && + (int)strlen(tmp->st) == stsize && (usnsize == 0 || strncmp(tmp->usn, usn, usnsize) == 0) && - tmp->usn[usnsize] == '\0') + (int)strlen(tmp->usn) == usnsize) break; } /* at the exit of the loop above, tmp is null if @@ -983,7 +982,7 @@ /* memory allocation error */ if(error) *error = MINISSDPC_MEMORY_ERROR; - goto error; + goto close_and_return; } tmp->pNext = devlist; tmp->descURL = tmp->buffer; @@ -1020,7 +1019,7 @@ } } } -error: +close_and_return: closesocket(sudp); return devlist; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/minissdpc.h new/miniupnpc-2.3.5/src/minissdpc.h --- old/miniupnpc-2.3.3/src/minissdpc.h 2019-02-10 13:30:19.000000000 +0100 +++ new/miniupnpc-2.3.5/src/minissdpc.h 2024-05-13 20:16:47.000000000 +0200 @@ -1,4 +1,4 @@ -/* $Id: minissdpc.h,v 1.8 2019/02/10 12:29:23 nanard Exp $ */ +/* $Id: minissdpc.h,v 1.6 2015/09/18 12:45:16 nanard Exp $ */ /* Project: miniupnp * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ * Author: Thomas Bernard diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/miniupnpc.c new/miniupnpc-2.3.5/src/miniupnpc.c --- old/miniupnpc-2.3.3/src/miniupnpc.c 2025-05-27 00:50:39.000000000 +0200 +++ new/miniupnpc-2.3.5/src/miniupnpc.c 2026-04-04 00:47:04.000000000 +0200 @@ -1,9 +1,9 @@ -/* $Id: miniupnpc.c,v 1.167 2025/05/25 21:56:48 nanard Exp $ */ +/* $Id: miniupnpc.c,v 1.165 2025/01/10 22:57:21 nanard Exp $ */ /* vim: tabstop=4 shiftwidth=4 noexpandtab * Project : miniupnp * Web : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ * Author : Thomas BERNARD - * copyright (c) 2005-2025 Thomas Bernard + * copyright (c) 2005-2026 Thomas Bernard * This software is subjet to the conditions detailed in the * provided LICENSE file. */ #include <stdlib.h> @@ -105,7 +105,7 @@ { char hostname[MAXHOSTNAMELEN+1]; unsigned short port = 0; - char * path; + const char * path; char soapact[128]; char soapbody[2048]; int soapbodylen; @@ -376,6 +376,7 @@ size_t l, n; char * s; const char * base; + const char * base_p; char * p; #if defined(IF_NAMESIZE) && !defined(_WIN32) char ifname[IF_NAMESIZE]; @@ -394,9 +395,9 @@ base = (baseurl[0] == '\0') ? descURL : baseurl; n = strlen(base); if(n > 7) { - p = strchr(base + 7, '/'); - if(p) - n = p - base; + base_p = strchr(base + 7, '/'); + if(base_p) + n = base_p - base; } l = n + strlen(url) + 1; if(url[0] != '/') @@ -405,6 +406,8 @@ #if defined(IF_NAMESIZE) && !defined(_WIN32) if(if_indextoname(scope_id, ifname)) { l += 3 + strlen(ifname); /* 3 == strlen(%25) */ + } else { + ifname[0] = '\0'; } #else /* defined(IF_NAMESIZE) && !defined(_WIN32) */ /* under windows, scope is numerical */ @@ -419,20 +422,22 @@ if(n > 13 && 0 == memcmp(s, "http://[fe80:", 13)) { /* this is a linklocal IPv6 address */ p = strchr(s, ']'); - if(p) { - /* insert %25<scope> into URL */ #if defined(IF_NAMESIZE) && !defined(_WIN32) + if(p && ifname[0]) { + /* insert %25<scope> into URL */ memmove(p + 3 + strlen(ifname), p, strlen(p) + 1); memcpy(p, "%25", 3); memcpy(p + 3, ifname, strlen(ifname)); n += 3 + strlen(ifname); + } #else /* defined(IF_NAMESIZE) && !defined(_WIN32) */ + if(p) { memmove(p + 3 + strlen(scope_str), p, strlen(p) + 1); memcpy(p, "%25", 3); memcpy(p + 3, scope_str, strlen(scope_str)); n += 3 + strlen(scope_str); -#endif /* defined(IF_NAMESIZE) && !defined(_WIN32) */ } +#endif /* defined(IF_NAMESIZE) && !defined(_WIN32) */ } } if(url[0] != '/') @@ -461,10 +466,11 @@ data->IPv6FC.controlurl, scope_id); #ifdef DEBUG - printf("urls->ipcondescURL='%s'\n", urls->ipcondescURL); - printf("urls->controlURL='%s'\n", urls->controlURL); - printf("urls->controlURL_CIF='%s'\n", urls->controlURL_CIF); - printf("urls->controlURL_6FC='%s'\n", urls->controlURL_6FC); +#define STRORNULL(s) ((s) == NULL ? "<null>" : (s)) + printf("urls->ipcondescURL='%s'\n", STRORNULL(urls->ipcondescURL)); + printf("urls->controlURL='%s'\n", STRORNULL(urls->controlURL)); + printf("urls->controlURL_CIF='%s'\n", STRORNULL(urls->controlURL_CIF)); + printf("urls->controlURL_6FC='%s'\n", STRORNULL(urls->controlURL_6FC)); #endif } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/miniupnpc_socketdef.h new/miniupnpc-2.3.5/src/miniupnpc_socketdef.h --- old/miniupnpc-2.3.3/src/miniupnpc_socketdef.h 2021-03-03 00:43:04.000000000 +0100 +++ new/miniupnpc-2.3.5/src/miniupnpc_socketdef.h 2024-05-13 20:16:47.000000000 +0200 @@ -1,4 +1,4 @@ -/* $Id: miniupnpc_socketdef.h,v 1.4 2021/03/02 23:35:29 nanard Exp $ */ +/* $Id: miniupnpc_socketdef.h,v 1.1 2018/03/13 23:44:10 nanard Exp $ */ /* Miniupnp project : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ * Author : Thomas Bernard * Copyright (c) 2018 Thomas Bernard diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/miniwget.c new/miniupnpc-2.3.5/src/miniwget.c --- old/miniupnpc-2.3.3/src/miniwget.c 2025-05-27 00:50:39.000000000 +0200 +++ new/miniupnpc-2.3.5/src/miniwget.c 2026-04-04 00:46:58.000000000 +0200 @@ -2,7 +2,7 @@ /* Project : miniupnp * Website : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ * Author : Thomas Bernard - * Copyright (c) 2005-2025 Thomas Bernard + * Copyright (c) 2005-2026 Thomas Bernard * This software is subject to the conditions detailed in the * LICENCE file provided in this distribution. */ @@ -59,6 +59,25 @@ #define MAXHOSTNAMELEN 64 #endif +/*\ brief convert decimal string to unsigned integer + * + * It reads decimal digits ('0' to '9') and stops as soon as it reaches + * the end pointer or a non-digit character + * + * \param start pointer to the 1st digit + * \param end pointer to the 1st character after the string + */ +static unsigned int +my_strtoui(const char * start, const char * end) +{ + unsigned int i = 0; + while ((start < end) && (*start >= '0') && (*start <= '9')) { + i = (i * 10) + (*start - '0'); + start++; + } + return i; +} + /* * Read a HTTP response from a socket. * Process Content-Length and Transfer-encoding headers. @@ -136,8 +155,7 @@ header_buf_used += n; /* search for CR LF CR LF (end of headers) * recognize also LF LF */ - i = 0; - while(i < ((int)header_buf_used-1) && (endofheaders == 0)) { + for(i = 0; i < ((int)header_buf_used-1) && (endofheaders == 0); i++) { if(header_buf[i] == '\r') { i++; if(header_buf[i] == '\n') { @@ -155,7 +173,6 @@ endofheaders = i+1; } } - i++; } if(endofheaders == 0) continue; @@ -183,7 +200,7 @@ if(*status_code < 0) { if (header_buf[sp+1] >= '1' && header_buf[sp+1] <= '9') - *status_code = atoi(header_buf + sp + 1); + *status_code = (int)my_strtoui(header_buf + sp + 1, header_buf + i); } else { @@ -208,7 +225,7 @@ #endif if(0==strncasecmp(header_buf+linestart, "content-length", colon-linestart)) { - content_length = atoi(header_buf+valuestart); + content_length = (int)my_strtoui(header_buf + valuestart, header_buf + i); #ifdef DEBUG printf("Content-Length: %d\n", content_length); #endif @@ -487,9 +504,9 @@ int parseURL(const char * url, char * hostname, unsigned short * port, - char * * path, unsigned int * scope_id) + const char * * path, unsigned int * scope_id) { - char * p1, *p2, *p3; + const char * p1, *p2, *p3; if(!url) return 0; p1 = strstr(url, "://"); @@ -503,7 +520,7 @@ if(*p1 == '[') { /* IP v6 : http://[2a00:1450:8002::6a]/path/abc */ - char * scope; + const char * scope; scope = strchr(p1, '%'); p2 = strchr(p1, ']'); if(p2 && scope && scope < p2 && scope_id) { @@ -594,7 +611,7 @@ unsigned int scope_id, int * status_code) { unsigned short port; - char * path; + const char * path; /* protocol://host:port/chemin */ char hostname[MAXHOSTNAMELEN+1]; *size = 0; @@ -613,7 +630,7 @@ int * status_code) { unsigned short port; - char * path; + const char * path; /* protocol://host:port/path */ char hostname[MAXHOSTNAMELEN+1]; *size = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/miniwget_private.h new/miniupnpc-2.3.5/src/miniwget_private.h --- old/miniupnpc-2.3.3/src/miniwget_private.h 2025-03-05 11:30:02.000000000 +0100 +++ new/miniupnpc-2.3.5/src/miniwget_private.h 2026-04-04 00:46:51.000000000 +0200 @@ -1,7 +1,7 @@ -/* $Id: miniwget_private.h,v 1.2 2025/03/02 01:14:38 nanard Exp $ */ +/* $Id: miniwget_private.h,v 1.1 2018/04/06 10:17:58 nanard Exp $ */ /* Project : miniupnp * Author : Thomas Bernard - * Copyright (c) 2018-2025 Thomas Bernard + * Copyright (c) 2018-2026 Thomas Bernard * This software is subject to the conditions detailed in the * LICENCE file provided in this distribution. * */ @@ -48,7 +48,7 @@ * \return 0 for failure, 1 for success */ int parseURL(const char * url, - char * hostname, unsigned short * port, char * * path, + char * hostname, unsigned short * port, const char * * path, unsigned int * scope_id); #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/minixml.c new/miniupnpc-2.3.5/src/minixml.c --- old/miniupnpc-2.3.3/src/minixml.c 2017-12-12 12:51:56.000000000 +0100 +++ new/miniupnpc-2.3.5/src/minixml.c 2026-08-12 01:43:03.000000000 +0200 @@ -2,10 +2,10 @@ /* vim: tabstop=4 shiftwidth=4 noexpandtab * minixml.c : the minimum size a xml parser can be ! */ /* Project : miniupnp - * webpage: http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ + * webpage: http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ * Author : Thomas Bernard -Copyright (c) 2005-2017, Thomas BERNARD +Copyright (c) 2005-2026, Thomas BERNARD All rights reserved. Redistribution and use in source and binary forms, with or without @@ -34,7 +34,7 @@ #include <string.h> #include "minixml.h" -/* parseatt : used to parse the argument list +/* parseatt : used to parse the attribute list * return 0 (false) in case of success and -1 (true) if the end * of the xmlbuffer is reached. */ static int parseatt(struct xmlparser * p) @@ -63,6 +63,9 @@ if(p->xml >= p->xmlend) return -1; } + /* p->xml points now to the character right after the '=' */ + if(p->xml >= p->xmlend) + return -1; while(IS_WHITE_SPACE(*p->xml)) { p->xml++; @@ -142,6 +145,8 @@ { i = 0; elementname = ++p->xml; + if (p->xml >= p->xmlend) + return; } } if(i>0) @@ -192,7 +197,7 @@ if ((p->xml + 1) >= p->xmlend) return; } - if(i>0 && p->datafunc && *(p->xml + 1) == '/') + if(i>0 && p->datafunc && (p->xml + 1) < p->xmlend && *(p->xml + 1) == '/') p->datafunc(p->data, data, i); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/minixml.h new/miniupnpc-2.3.5/src/minixml.h --- old/miniupnpc-2.3.3/src/minixml.h 2019-02-10 13:30:19.000000000 +0100 +++ new/miniupnpc-2.3.5/src/minixml.h 2024-05-13 20:16:47.000000000 +0200 @@ -1,4 +1,4 @@ -/* $Id: minixml.h,v 1.8 2019/02/10 12:29:25 nanard Exp $ */ +/* $Id: minixml.h,v 1.6 2006/11/30 11:47:21 nanard Exp $ */ /* minimal xml parser * * Project : miniupnp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/receivedata.c new/miniupnpc-2.3.5/src/receivedata.c --- old/miniupnpc-2.3.3/src/receivedata.c 2025-05-27 00:50:39.000000000 +0200 +++ new/miniupnpc-2.3.5/src/receivedata.c 2026-02-05 23:32:55.000000000 +0100 @@ -63,6 +63,14 @@ /* using select under _WIN32 and amigaos */ fd_set socketSet; TIMEVAL timeval; +#ifndef _WIN32 + /* Non-Windows, one needs to ensure the socket fd is within range */ + if(socket >= FD_SETSIZE) { + fprintf(stderr, "Socket %d is >= FD_SETSIZE %d\n", + (int)socket, (int)FD_SETSIZE); + return -1; + } +#endif FD_ZERO(&socketSet); FD_SET(socket, &socketSet); timeval.tv_sec = timeout / 1000; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/receivedata.h new/miniupnpc-2.3.5/src/receivedata.h --- old/miniupnpc-2.3.3/src/receivedata.h 2018-04-06 12:53:30.000000000 +0200 +++ new/miniupnpc-2.3.5/src/receivedata.h 2024-05-13 20:16:47.000000000 +0200 @@ -1,4 +1,4 @@ -/* $Id: receivedata.h,v 1.5 2018/04/06 10:53:15 nanard Exp $ */ +/* $Id: receivedata.h,v 1.3 2012/06/23 22:34:47 nanard Exp $ */ /* Project: miniupnp * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ * Author: Thomas Bernard diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/testaddr_is_reserved.c new/miniupnpc-2.3.5/src/testaddr_is_reserved.c --- old/miniupnpc-2.3.3/src/testaddr_is_reserved.c 2020-10-16 00:12:51.000000000 +0200 +++ new/miniupnpc-2.3.5/src/testaddr_is_reserved.c 2024-05-13 20:16:47.000000000 +0200 @@ -1,4 +1,4 @@ -/* $Id: testaddr_is_reserved.c,v 1.1 2020/10/15 22:12:51 nanard Exp $ */ +/* $Id: $ */ /* vim: tabstop=4 shiftwidth=4 noexpandtab * Project : miniupnp * Web : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/testigddescparse.c new/miniupnpc-2.3.5/src/testigddescparse.c --- old/miniupnpc-2.3.3/src/testigddescparse.c 2019-02-10 14:25:00.000000000 +0100 +++ new/miniupnpc-2.3.5/src/testigddescparse.c 2024-05-13 20:16:47.000000000 +0200 @@ -1,4 +1,4 @@ -/* $Id: testigddescparse.c,v 1.11 2019/02/10 12:33:32 nanard Exp $ */ +/* $Id: testigddescparse.c,v 1.8 2015/02/08 08:46:06 nanard Exp $ */ /* Project : miniupnp * http://miniupnp.free.fr/ * Author : Thomas Bernard diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/testminiwget.c new/miniupnpc-2.3.5/src/testminiwget.c --- old/miniupnpc-2.3.3/src/testminiwget.c 2018-01-19 00:47:27.000000000 +0100 +++ new/miniupnpc-2.3.5/src/testminiwget.c 2024-05-13 20:16:47.000000000 +0200 @@ -1,4 +1,4 @@ -/* $Id: testminiwget.c,v 1.7 2018/01/16 01:01:05 nanard Exp $ */ +/* $Id: testminiwget.c,v 1.6 2017/11/02 16:52:37 nanard Exp $ */ /* vim: tabstop=4 shiftwidth=4 noexpandtab * Project : miniupnp * Author : Thomas Bernard diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/testminixml.c new/miniupnpc-2.3.5/src/testminixml.c --- old/miniupnpc-2.3.3/src/testminixml.c 2014-11-26 11:42:59.000000000 +0100 +++ new/miniupnpc-2.3.5/src/testminixml.c 2026-03-23 02:00:05.000000000 +0100 @@ -1,8 +1,8 @@ /* $Id: testminixml.c,v 1.10 2014/11/17 17:19:13 nanard Exp $ * MiniUPnP project - * Website : http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ + * Website : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ * Author : Thomas Bernard. - * Copyright (c) 2005-2014 Thomas Bernard + * Copyright (c) 2005-2026 Thomas Bernard * * testminixml.c * test program for the "minixml" functions. @@ -57,6 +57,7 @@ parser.starteltfunc = IGDstartelt; parser.endeltfunc = IGDendelt; parser.datafunc = IGDdata; + parser.attfunc = 0; parsexml(&parser); #ifdef DEBUG printIGD(&data); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/testupnpreplyparse.c new/miniupnpc-2.3.5/src/testupnpreplyparse.c --- old/miniupnpc-2.3.3/src/testupnpreplyparse.c 2017-12-12 12:51:56.000000000 +0100 +++ new/miniupnpc-2.3.5/src/testupnpreplyparse.c 2026-09-12 01:39:32.000000000 +0200 @@ -1,7 +1,7 @@ -/* $Id: testupnpreplyparse.c,v 1.5 2017/12/12 11:18:46 nanard Exp $ */ +/* $Id: testupnpreplyparse.c,v 1.4 2014/01/27 11:45:19 nanard Exp $ */ /* MiniUPnP project - * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ - * (c) 2006-2017 Thomas Bernard + * http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ + * (c) 2006-2026 Thomas Bernard * This software is subject to the conditions detailed * in the LICENCE file provided within the distribution */ #include <stdio.h> @@ -54,21 +54,34 @@ int main(int argc, char * * argv) { - FILE * f; + FILE * f = NULL; char * buffer; long l; + int i; int ok; + int add_null_terminator = 0; + const char * name_value_file = NULL; - if(argc<2) - { - fprintf(stderr, "Usage: %s file.xml [file.namevalues]\n", argv[0]); + if(argc<2 || 0 == strcmp("--help", argv[1]) || 0 == strcmp("-h", argv[1])) { + fprintf(stderr, "Usage: %s [--nullterminate] file.xml [file.namevalues]\n", argv[0]); return 1; } - f = fopen(argv[1], "r"); - if(!f) - { - fprintf(stderr, "Error : can not open file %s\n", argv[1]); - return 2; + for(i = 1; i < argc; i++) { + if(0 == strcmp(argv[i], "--nullterminate")) { + add_null_terminator = 1; + } else if(f == NULL) { + f = fopen(argv[i], "r"); + if(!f) + { + fprintf(stderr, "Error : can not open file %s\n", argv[1]); + return 2; + } + } else if(name_value_file == NULL) { + name_value_file = argv[i]; + } else { + fprintf(stderr, "unrecognized argument %s\n", argv[i]); + return 1; + } } if(fseek(f, 0, SEEK_END) < 0) { perror("fseek"); @@ -83,7 +96,7 @@ perror("fseek"); return 1; } - buffer = malloc(l + 1); + buffer = malloc(l + (add_null_terminator ? 1 : 0)); if(buffer == NULL) { fprintf(stderr, "Error: failed to allocate %ld bytes\n", l+1); return 1; @@ -91,13 +104,15 @@ l = fread(buffer, 1, l, f); fclose(f); f = NULL; - buffer[l] = '\0'; - if(argc > 2) + if(add_null_terminator) { + buffer[l] = '\0'; + } + if(name_value_file) { - f = fopen(argv[2], "r"); + f = fopen(name_value_file, "r"); if(!f) { - fprintf(stderr, "Error : can not open file %s\n", argv[2]); + fprintf(stderr, "Error : can not open file %s\n", name_value_file); return 2; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/upnpc.c new/miniupnpc-2.3.5/src/upnpc.c --- old/miniupnpc-2.3.3/src/upnpc.c 2025-01-11 00:02:54.000000000 +0100 +++ new/miniupnpc-2.3.5/src/upnpc.c 2026-08-12 01:43:03.000000000 +0200 @@ -1,7 +1,7 @@ /* $Id: upnpc.c,v 1.146 2025/01/10 23:02:54 nanard Exp $ */ /* Project : miniupnp * Author : Thomas Bernard - * Copyright (c) 2005-2025 Thomas Bernard + * Copyright (c) 2005-2026 Thomas Bernard * This software is subject to the conditions detailed in the * LICENCE file provided in this distribution. */ @@ -631,9 +631,9 @@ return -1; } #endif - printf("upnpc: miniupnpc library test client, version %s.\n", MINIUPNPC_VERSION_STRING); - printf(" (c) 2005-2025 Thomas Bernard.\n"); - printf("More information at https://miniupnp.tuxfamily.org/ or http://miniupnp.free.fr/\n\n"); + printf("upnpc: miniupnpc library test client, version %s.\n", MINIUPNPC_VERSION_STRING); + printf(" (c) 2005-2026 Thomas Bernard.\n"); + printf("More information at https://miniupnp.tuxfamily.org/ or http://miniupnp.free.fr/\n\n"); /* command line processing */ for(i=1; i<argc; i++) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/src/upnpreplyparse.c new/miniupnpc-2.3.5/src/upnpreplyparse.c --- old/miniupnpc-2.3.3/src/upnpreplyparse.c 2025-03-05 11:30:03.000000000 +0100 +++ new/miniupnpc-2.3.5/src/upnpreplyparse.c 2025-03-02 02:21:04.000000000 +0100 @@ -1,4 +1,4 @@ -/* $Id: upnpreplyparse.c,v 1.23 2025/03/02 01:12:59 nanard Exp $ */ +/* $Id: upnpreplyparse.c,v 1.22 2025/02/08 23:12:26 nanard Exp $ */ /* vim: tabstop=4 shiftwidth=4 noexpandtab * MiniUPnP project * http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/testminiwget.sh new/miniupnpc-2.3.5/testminiwget.sh --- old/miniupnpc-2.3.3/testminiwget.sh 2022-10-21 23:10:26.000000000 +0200 +++ new/miniupnpc-2.3.5/testminiwget.sh 2024-05-13 20:16:47.000000000 +0200 @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: testminiwget.sh,v 1.20 2022/10/21 21:09:42 nanard Exp $ +# $Id: testminiwget.sh,v 1.18 2020/05/29 21:14:22 nanard Exp $ # vim: tabstop=4 shiftwidth=4 noexpandtab # project miniupnp : http://miniupnp.free.fr/ # or https://miniupnp.tuxfamily.org/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/updateminiupnpcstrings.sh new/miniupnpc-2.3.5/updateminiupnpcstrings.sh --- old/miniupnpc-2.3.3/updateminiupnpcstrings.sh 2022-10-16 07:47:13.000000000 +0200 +++ new/miniupnpc-2.3.5/updateminiupnpcstrings.sh 2024-05-13 20:16:47.000000000 +0200 @@ -1,5 +1,5 @@ #! /bin/sh -# $Id: updateminiupnpcstrings.sh,v 1.10 2022/10/16 05:28:15 nanard Exp $ +# $Id: updateminiupnpcstrings.sh,v 1.9 2021/09/28 21:37:53 nanard Exp $ # project miniupnp : http://miniupnp.free.fr/ # (c) 2009-2021 Thomas Bernard diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/miniupnpc-2.3.3/wingenminiupnpcstrings.c new/miniupnpc-2.3.5/wingenminiupnpcstrings.c --- old/miniupnpc-2.3.3/wingenminiupnpcstrings.c 2021-09-28 23:11:32.000000000 +0200 +++ new/miniupnpc-2.3.5/wingenminiupnpcstrings.c 2024-05-13 20:16:47.000000000 +0200 @@ -1,4 +1,4 @@ -/* $Id: wingenminiupnpcstrings.c,v 1.6 2021/08/21 09:43:40 nanard Exp $ */ +/* $Id: wingenminiupnpcstrings.c,v 1.4 2015/02/08 08:46:06 nanard Exp $ */ /* Project: miniupnp * http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ * Author: Thomas Bernard
