Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libupnp for openSUSE:Factory checked in at 2026-04-28 11:53:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libupnp (Old) and /work/SRC/openSUSE:Factory/.libupnp.new.11940 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libupnp" Tue Apr 28 11:53:35 2026 rev:46 rq:1349318 version:1.18.5 Changes: -------- --- /work/SRC/openSUSE:Factory/libupnp/libupnp.changes 2026-03-29 20:00:33.817113964 +0200 +++ /work/SRC/openSUSE:Factory/.libupnp.new.11940/libupnp.changes 2026-04-28 11:53:56.247442754 +0200 @@ -1,0 +2,6 @@ +Sat Apr 25 22:50:17 UTC 2026 - Jan Engelhardt <[email protected]> + +- Update to release 1.18.5 + * Fixed CVE-2026-41682 + +------------------------------------------------------------------- Old: ---- libupnp-1.18.4.tar.bz2 New: ---- libupnp-1.18.5.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libupnp.spec ++++++ --- /var/tmp/diff_new_pack.91zA58/_old 2026-04-28 11:53:56.843467366 +0200 +++ /var/tmp/diff_new_pack.91zA58/_new 2026-04-28 11:53:56.843467366 +0200 @@ -20,7 +20,7 @@ %define pnpver 20 %define ixmlver 11 Name: libupnp -Version: 1.18.4 +Version: 1.18.5 Release: 0 Summary: An implementation of Universal Plug and Play (UPnP) License: BSD-3-Clause ++++++ _scmsync.obsinfo ++++++ --- /var/tmp/diff_new_pack.91zA58/_old 2026-04-28 11:53:56.875468687 +0200 +++ /var/tmp/diff_new_pack.91zA58/_new 2026-04-28 11:53:56.879468852 +0200 @@ -1,5 +1,5 @@ -mtime: 1774687646 -commit: c7d3028ed82d8e6a0aeb2e0c1b1a41db0e457dae86de5e43fbb05f32b6b46ec7 +mtime: 1777157447 +commit: f4724267c29d6d2182117b6d0baf826fee9f91817bbb2e7b94ee410b881b9122 url: https://src.opensuse.org/jengelh/libupnp revision: master ++++++ build.specials.obscpio ++++++ ++++++ build.specials.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.gitignore new/.gitignore --- old/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/.gitignore 2026-04-26 00:50:47.000000000 +0200 @@ -0,0 +1 @@ +.osc ++++++ libupnp-1.18.4.tar.bz2 -> libupnp-1.18.5.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libupnp-1.18.4/.gitignore new/libupnp-1.18.5/.gitignore --- old/libupnp-1.18.4/.gitignore 2026-03-27 19:26:03.000000000 +0100 +++ new/libupnp-1.18.5/.gitignore 2026-04-22 21:28:40.000000000 +0200 @@ -136,14 +136,11 @@ docs/doxygen # Testing +ixml/test_* +ixml/poc_gh_* +upnp/test_* *.trs *.log -ixml/test_document -ixml/poc_gh_506 -upnp/test_init -upnp/test_url -upnp/test_list -upnp/test_log upnp/generator/generator diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libupnp-1.18.4/ChangeLog new/libupnp-1.18.5/ChangeLog --- old/libupnp-1.18.4/ChangeLog 2026-03-27 19:26:03.000000000 +0100 +++ new/libupnp-1.18.5/ChangeLog 2026-04-22 21:28:40.000000000 +0200 @@ -1,4 +1,10 @@ ******************************************************************************* +Version 1.18.5 +******************************************************************************* + +- Fix for CVE-2026-41682 + +******************************************************************************* Version 1.18.4 ******************************************************************************* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libupnp-1.18.4/README.md new/libupnp-1.18.5/README.md --- old/libupnp-1.18.4/README.md 2026-03-27 19:26:03.000000000 +0100 +++ new/libupnp-1.18.5/README.md 2026-04-22 21:28:40.000000000 +0200 @@ -100,12 +100,14 @@ | Release Number | Date | History | | -------------- | ---------- | ---------------------------------------- | +| 1.18.5 | 2026-04-22 | [Portable UPnP SDK][Portable UPnP SDK] | | 1.18.4 | 2026-03-27 | [Portable UPnP SDK][Portable UPnP SDK] | | 1.18.3 | 2026-03-16 | [Portable UPnP SDK][Portable UPnP SDK] | | 1.18.2 | 2026-03-10 | [Portable UPnP SDK][Portable UPnP SDK] | | 1.18.1 | 2026-03-01 | [Portable UPnP SDK][Portable UPnP SDK] | | 1.18.0 | 2026-02-09 | [Portable UPnP SDK][Portable UPnP SDK] | | 1.16.0 | canceled | [Portable UPnP SDK][Portable UPnP SDK] | +| 1.14.31 | 2026-04-22 | [Portable UPnP SDK][Portable UPnP SDK] | | 1.14.30 | 2026-02-09 | [Portable UPnP SDK][Portable UPnP SDK] | | 1.14.29 | 2026-02-08 | [Portable UPnP SDK][Portable UPnP SDK] | | 1.14.28 | 2026-02-08 | [Portable UPnP SDK][Portable UPnP SDK] | diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libupnp-1.18.4/cmake/test-functions.cmake new/libupnp-1.18.5/cmake/test-functions.cmake --- old/libupnp-1.18.4/cmake/test-functions.cmake 2026-03-27 19:26:03.000000000 +0100 +++ new/libupnp-1.18.5/cmake/test-functions.cmake 2026-04-22 21:28:40.000000000 +0200 @@ -10,7 +10,7 @@ ) endif() - upnp_addtestexecutable(${testName} ${sourceFile}) + UPNP_Add_Test_Executable(${testName} ${sourceFile}) if(UPNP_BUILD_SHARED) if(agm_ADDITIONAL_INCLUDE_DIRS) @@ -29,7 +29,7 @@ ) if(MSVC) - upnp_findtestenv(${testName} TEST_ENV) + UPNP_Find_Test_Env(${testName} TEST_ENV) set_tests_properties( ${GTEST_${testName}} PROPERTIES ENVIRONMENT @@ -37,7 +37,7 @@ ) endif() - upnp_findtestenv(${testName} TEST_ENV) + UPNP_Find_Test_Env(${testName} TEST_ENV) endif() if(UPNP_BUILD_STATIC) @@ -58,7 +58,7 @@ endif() endfunction() -function(UPNP_addTestExecutable testName sourceFile) +function(UPNP_Add_Test_Executable testName sourceFile) if(UPNP_BUILD_SHARED) add_executable(${testName} ${sourceFile}) target_link_libraries(${testName} PRIVATE upnp_shared) @@ -82,8 +82,8 @@ endif() endfunction() -function(UPNP_addUnitTest testName sourceFile) - upnp_addtestexecutable(${testName} ${sourceFile}) +function(UPNP_Add_Unit_Test testName sourceFile) + UPNP_Add_Test_Executable(${testName} ${sourceFile}) if(UPNP_BUILD_SHARED) add_test(NAME ${testName} COMMAND ${testName}) @@ -93,7 +93,7 @@ OR MINGW OR CYGWIN ) - upnp_findtestenv(${testName} TEST_ENV) + UPNP_Find_Test_Env(${testName} TEST_ENV) set_tests_properties( ${testName} PROPERTIES ENVIRONMENT @@ -108,8 +108,8 @@ endfunction() # For MSVC toolchain only -function(UPNP_findTestEnv testName resultVar) - upnp_findtestlibs(${testName} ${resultVar}) +function(UPNP_Find_Test_Env testName resultVar) + UPNP_Find_Test_Libs(${testName} ${resultVar}) set(tempEnv "PATH=") if(MSVC OR MINGW) @@ -129,7 +129,7 @@ ) endfunction() -function(UPNP_findTestLibs testName resultVar) +function(UPNP_Find_Test_Libs testName resultVar) unset(linkLibs) if(NOT TARGET ${testName}) @@ -150,7 +150,7 @@ ) foreach(lib IN ITEMS ${linkLibs}) - upnp_findtestlibs(${lib} ${resultVar}) + UPNP_Find_Test_Libs(${lib} ${resultVar}) if(NOT TARGET ${lib}) set(interface2 TRUE) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libupnp-1.18.4/configure new/libupnp-1.18.5/configure --- old/libupnp-1.18.4/configure 2026-03-27 19:26:06.000000000 +0100 +++ new/libupnp-1.18.5/configure 2026-04-22 21:28:44.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for libupnp 1.18.4. +# Generated by GNU Autoconf 2.71 for libupnp 1.18.5. # # Report bugs to <[email protected]>. # @@ -621,8 +621,8 @@ # Identity of this package. PACKAGE_NAME='libupnp' PACKAGE_TARNAME='libupnp' -PACKAGE_VERSION='1.18.4' -PACKAGE_STRING='libupnp 1.18.4' +PACKAGE_VERSION='1.18.5' +PACKAGE_STRING='libupnp 1.18.5' PACKAGE_BUGREPORT='[email protected]' PACKAGE_URL='' @@ -1446,7 +1446,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libupnp 1.18.4 to adapt to many kinds of systems. +\`configure' configures libupnp 1.18.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1517,7 +1517,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libupnp 1.18.4:";; + short | recursive ) echo "Configuration of libupnp 1.18.5:";; esac cat <<\_ACEOF @@ -1667,7 +1667,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libupnp configure 1.18.4 +libupnp configure 1.18.5 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -2147,7 +2147,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libupnp $as_me 1.18.4, which was +It was created by libupnp $as_me 1.18.5, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3121,9 +3121,9 @@ LT_VERSION_IXML=12:8:1 -LT_VERSION_UPNP=20:4:0 +LT_VERSION_UPNP=20:5:0 + -++++++++++++++ @@ -3643,7 +3643,7 @@ # Define the identity of the package. PACKAGE='libupnp' - VERSION='1.18.4' + VERSION='1.18.5' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -22117,7 +22117,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libupnp $as_me 1.18.4, which was +This file was extended by libupnp $as_me 1.18.5, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -22185,7 +22185,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -libupnp config.status 1.18.4 +libupnp config.status 1.18.5 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libupnp-1.18.4/configure.ac new/libupnp-1.18.5/configure.ac --- old/libupnp-1.18.4/configure.ac 2026-03-27 19:26:03.000000000 +0100 +++ new/libupnp-1.18.5/configure.ac 2026-04-22 21:28:40.000000000 +0200 @@ -23,9 +23,18 @@ dnl # *please update only once, before a formal release, not for each change* dnl # dnl ############################################################################ -AC_INIT([libupnp],[1.18.4],[[email protected]]) +AC_INIT([libupnp],[1.18.5],[[email protected]]) AC_SUBST([LT_VERSION_IXML], [12:8:1]) -AC_SUBST([LT_VERSION_UPNP], [20:4:0]) +AC_SUBST([LT_VERSION_UPNP], [20:5:0]) +dnl ############################################################################ +dnl # Release 1.18.5 +dnl # "current:revision:age" +dnl # +dnl # - Code has changed in upnp +dnl # revision: 4 -> 5 +dnl # +dnl #AC_SUBST([LT_VERSION_IXML], [12:8:1]) +dnl #AC_SUBST([LT_VERSION_UPNP], [20:5:0]) dnl ############################################################################ dnl # Release 1.18.4 dnl # "current:revision:age" @@ -65,20 +74,20 @@ dnl # dnl #AC_SUBST([LT_VERSION_IXML], [12:8:1]) dnl #AC_SUBST([LT_VERSION_UPNP], [20:1:0]) -+dnl ############################################################################ -+dnl # Release 1.18.0 -+dnl # "current:revision:age" -+dnl # -+dnl # - Code has changed in upnp -+dnl # revision: 10 -> 11 -+dnl # - interfaces changed/added/removed in upnp -+dnl # current: 19 -> 20 -+dnl # revision: 11 -> 0 -+dnl # - interfaces removed or changed in upnp -+dnl # age: 1 -> 0 -+dnl # -+dnl #AC_SUBST([LT_VERSION_IXML], [12:7:1]) -+dnl #AC_SUBST([LT_VERSION_UPNP], [20:0:0]) +dnl ############################################################################ +dnl # Release 1.18.0 +dnl # "current:revision:age" +dnl # +dnl # - Code has changed in upnp +dnl # revision: 10 -> 11 +dnl # - interfaces changed/added/removed in upnp +dnl # current: 19 -> 20 +dnl # revision: 11 -> 0 +dnl # - interfaces removed or changed in upnp +dnl # age: 1 -> 0 +dnl # +dnl #AC_SUBST([LT_VERSION_IXML], [12:7:1]) +dnl #AC_SUBST([LT_VERSION_UPNP], [20:0:0]) dnl ############################################################################ dnl # Release 1.14.30 dnl # "current:revision:age" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libupnp-1.18.4/docs/Doxyfile new/libupnp-1.18.5/docs/Doxyfile --- old/libupnp-1.18.4/docs/Doxyfile 2026-03-27 19:26:03.000000000 +0100 +++ new/libupnp-1.18.5/docs/Doxyfile 2026-04-22 21:28:40.000000000 +0200 @@ -38,7 +38,7 @@ # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.18.4 +PROJECT_NUMBER = 1.18.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/libupnp-1.18.4/libupnp.spec new/libupnp-1.18.5/libupnp.spec --- old/libupnp-1.18.4/libupnp.spec 2026-03-27 19:26:03.000000000 +0100 +++ new/libupnp-1.18.5/libupnp.spec 2026-04-22 21:28:40.000000000 +0200 @@ -1,4 +1,4 @@ -Version: 1.18.4 +Version: 1.18.5 Summary: Universal Plug and Play (UPnP) SDK Name: libupnp-1.18 Release: 1%{?dist} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libupnp-1.18.4/scripts/comp-autotools.sh new/libupnp-1.18.5/scripts/comp-autotools.sh --- old/libupnp-1.18.4/scripts/comp-autotools.sh 2026-03-27 19:26:03.000000000 +0100 +++ new/libupnp-1.18.5/scripts/comp-autotools.sh 2026-04-22 21:28:40.000000000 +0200 @@ -1,57 +1,68 @@ #! /bin/bash +die () { + local ERR_CODE=$1 + shift + local MESSAGE=( "$@" ) + + echo "${MESSAGE[@]}" + exit "${ERR_CODE}" +} + +GIT_ROOT=$(git rev-parse --show-toplevel) +[[ ${PWD} == "${GIT_ROOT}" ]] || die 1 \ + "The current path is: '${PWD}'" \ + $'\n' \ + "This script must be run in '${GIT_ROOT}'" + +make distclean +find . -path "./upnp/generator" -prune -o -name Makefile -exec rm '{}' \; +find . -name '*.o' -exec rm '{}' \; + +./bootstrap || die 2 "'bootstrap' failed" + #if false; then echo "debug, no openssl dynamic, no sanitizer:" - ./bootstrap && \ - ./configure --enable-debug --enable-shared --prefix=/home/mroberto/usr/libupnp CFLAGS="-Wconversion -Wchar-subscripts -Wall -Wextra -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute" && \ - make clean > /dev/null && \ - make -j8 > /dev/null && \ - make install > /dev/null + ./configure --enable-debug --enable-shared --prefix="${HOME}"/usr/libupnp CFLAGS="-Wconversion -Wchar-subscripts -Wall -Wextra -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute" #fi if false; then echo "debug, no openssl static:" - ./bootstrap && \ - ./configure --enable-debug --disable-shared --prefix=/home/mroberto/usr/libupnp CFLAGS="-Wconversion -Wchar-subscripts -Wall -Wextra -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fsanitize=address,leak" LDFLAGS="-fsanitize=address,leak" && \ - make clean > /dev/null && \ - make -j8 > /dev/null && \ - make install > /dev/null + ./configure --enable-debug --disable-shared --prefix="${HOME}"/usr/libupnp CFLAGS="-Wconversion -Wchar-subscripts -Wall -Wextra -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fsanitize=address,leak" LDFLAGS="-fsanitize=address,leak" fi if false; then echo "debug, no openssl static, no leak sanitizer, for gdb debugging:" - ./bootstrap && \ - ./configure --enable-debug --disable-shared --prefix=/home/mroberto/usr/libupnp CFLAGS="-Wconversion -Wchar-subscripts -Wall -Wextra -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute" && \ - make clean > /dev/null && \ - make -j8 > /dev/null && \ - make install > /dev/null + ./configure --enable-debug --disable-shared --prefix="${HOME}"/usr/libupnp CFLAGS="-Wconversion -Wchar-subscripts -Wall -Wextra -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute" fi if false; then echo "debug, with shared lib:" - ./bootstrap && \ - ./configure --enable-debug --enable-open_ssl --prefix=/home/mroberto/usr/libupnp CFLAGS="-Wconversion -Wchar-subscripts -Wall -Wextra -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fsanitize=address,leak" LDFLAGS="-fsanitize=address,leak" && \ - make clean > /dev/null && \ - make -j8 > /dev/null && \ - make install > /dev/null + ./configure --enable-debug --enable-open_ssl --prefix="${HOME}"/usr/libupnp CFLAGS="-Wconversion -Wchar-subscripts -Wall -Wextra -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fsanitize=address,leak" LDFLAGS="-fsanitize=address,leak" fi if false; then echo "#no debug:" - ./bootstrap && \ - ./configure --prefix=/home/mroberto/usr/libupnp CFLAGS="-Wconversion -Wchar-subscripts -Wall -Wextra -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute" && \ - make clean > /dev/null && \ - make -j8 > /dev/null && \ - make install > /dev/null + ./configure --prefix="${HOME}"/usr/libupnp CFLAGS="-Wconversion -Wchar-subscripts -Wall -Wextra -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute" fi -if false; then - echo "cmake build" - rm -rf build - cmake -DBUILD_TESTING=ON -DDOWNLOAD_AND_BUILD_DEPS=ON -DCMAKE_BUILD_TYPE=Debug -S . -B build - cmake --build build - cd build || exit 1 - ctest --output-on-failure -fi +# shellcheck disable=SC2181 +[[ $? == 0 ]] || die 3 "'configure' failed" + +make clean > /dev/null || die 4 "'make clean' failed" +make -j8 > /dev/null || die 5 "'make' failed" +make check || die 6 "'make check' failed" +make install > /dev/null || die 7 "'make install' failed" + +die 0 "success" + +# if false; then +# echo "cmake build" +# rm -rf build +# cmake -DBUILD_TESTING=ON -DDOWNLOAD_AND_BUILD_DEPS=ON -DCMAKE_BUILD_TYPE=Debug -S . -B build +# cmake --build build +# cd build || exit 1 +# ctest --output-on-failure +# fi -exit +# exit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libupnp-1.18.4/upnp/Makefile.am new/libupnp-1.18.5/upnp/Makefile.am --- old/libupnp-1.18.4/upnp/Makefile.am 2026-03-27 19:26:03.000000000 +0100 +++ new/libupnp-1.18.5/upnp/Makefile.am 2026-04-22 21:28:40.000000000 +0200 @@ -8,6 +8,8 @@ AM_CPPFLAGS = \ -I$(srcdir)/inc \ + -I$(srcdir)/src/inc \ + -I$(srcdir)/src/threadutil \ -I$(top_srcdir)/ixml/inc LDADD = \ @@ -195,12 +197,14 @@ endif # check / distcheck tests -check_PROGRAMS = test_init test_url test_log test_list -TESTS = test_init test_url test_log test_list +check_PROGRAMS = test_init test_url test_log test_list test_parse_uri +TESTS = test_init test_url test_log test_list test_parse_uri test_init_SOURCES = test/test_init.c test_url_SOURCES = test/test_url.c test_log_SOURCES = test/test_log.c test_list_SOURCES = test/test_list.c +test_parse_uri_SOURCES = test/test_parse_uri.c test/test_parse_uri_impl.c +test_parse_uri_LDADD = $(LDADD) EXTRA_DIST = \ m4/libupnp.m4 \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libupnp-1.18.4/upnp/Makefile.in new/libupnp-1.18.5/upnp/Makefile.in --- old/libupnp-1.18.4/upnp/Makefile.in 2026-03-27 19:26:07.000000000 +0100 +++ new/libupnp-1.18.5/upnp/Makefile.in 2026-04-22 21:28:45.000000000 +0200 @@ -143,9 +143,9 @@ @WINDOWS_TRUE@ src/inc/inet_pton.h check_PROGRAMS = test_init$(EXEEXT) test_url$(EXEEXT) \ - test_log$(EXEEXT) test_list$(EXEEXT) + test_log$(EXEEXT) test_list$(EXEEXT) test_parse_uri$(EXEEXT) TESTS = test_init$(EXEEXT) test_url$(EXEEXT) test_log$(EXEEXT) \ - test_list$(EXEEXT) + test_list$(EXEEXT) test_parse_uri$(EXEEXT) subdir = upnp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cflags_gcc_option.m4 \ @@ -313,6 +313,10 @@ test_log_OBJECTS = $(am_test_log_OBJECTS) test_log_LDADD = $(LDADD) test_log_DEPENDENCIES = libupnp.la $(top_builddir)/ixml/libixml.la +am_test_parse_uri_OBJECTS = test/test_parse_uri.$(OBJEXT) \ + test/test_parse_uri_impl.$(OBJEXT) +test_parse_uri_OBJECTS = $(am_test_parse_uri_OBJECTS) +test_parse_uri_DEPENDENCIES = $(LDADD) am_test_url_OBJECTS = test/test_url.$(OBJEXT) test_url_OBJECTS = $(am_test_url_OBJECTS) test_url_LDADD = $(LDADD) @@ -382,7 +386,9 @@ src/uuid/$(DEPDIR)/libupnp_la-sysdep.Plo \ src/uuid/$(DEPDIR)/libupnp_la-uuid.Plo \ test/$(DEPDIR)/test_init.Po test/$(DEPDIR)/test_list.Po \ - test/$(DEPDIR)/test_log.Po test/$(DEPDIR)/test_url.Po + test/$(DEPDIR)/test_log.Po test/$(DEPDIR)/test_parse_uri.Po \ + test/$(DEPDIR)/test_parse_uri_impl.Po \ + test/$(DEPDIR)/test_url.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -403,9 +409,11 @@ am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libupnp_la_SOURCES) $(test_init_SOURCES) \ - $(test_list_SOURCES) $(test_log_SOURCES) $(test_url_SOURCES) + $(test_list_SOURCES) $(test_log_SOURCES) \ + $(test_parse_uri_SOURCES) $(test_url_SOURCES) DIST_SOURCES = $(am__libupnp_la_SOURCES_DIST) $(test_init_SOURCES) \ - $(test_list_SOURCES) $(test_log_SOURCES) $(test_url_SOURCES) + $(test_list_SOURCES) $(test_log_SOURCES) \ + $(test_parse_uri_SOURCES) $(test_url_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ @@ -799,8 +807,9 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = . sample -AM_CPPFLAGS = -I$(srcdir)/inc -I$(top_srcdir)/ixml/inc $(am__append_7) \ - $(am__append_8) +AM_CPPFLAGS = -I$(srcdir)/inc -I$(srcdir)/src/inc \ + -I$(srcdir)/src/threadutil -I$(top_srcdir)/ixml/inc \ + $(am__append_7) $(am__append_8) LDADD = \ libupnp.la \ $(top_builddir)/ixml/libixml.la @@ -867,6 +876,8 @@ test_url_SOURCES = test/test_url.c test_log_SOURCES = test/test_log.c test_list_SOURCES = test/test_list.c +test_parse_uri_SOURCES = test/test_parse_uri.c test/test_parse_uri_impl.c +test_parse_uri_LDADD = $(LDADD) EXTRA_DIST = \ m4/libupnp.m4 \ src/win_dll.c @@ -1179,6 +1190,14 @@ test_log$(EXEEXT): $(test_log_OBJECTS) $(test_log_DEPENDENCIES) $(EXTRA_test_log_DEPENDENCIES) @rm -f test_log$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_log_OBJECTS) $(test_log_LDADD) $(LIBS) +test/test_parse_uri.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/test_parse_uri_impl.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) + +test_parse_uri$(EXEEXT): $(test_parse_uri_OBJECTS) $(test_parse_uri_DEPENDENCIES) $(EXTRA_test_parse_uri_DEPENDENCIES) + @rm -f test_parse_uri$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_parse_uri_OBJECTS) $(test_parse_uri_LDADD) $(LIBS) test/test_url.$(OBJEXT): test/$(am__dirstamp) \ test/$(DEPDIR)/$(am__dirstamp) @@ -1275,6 +1294,8 @@ @AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_init.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_list.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_log.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_parse_uri.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_parse_uri_impl.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_url.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @@ -1981,6 +2002,13 @@ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +test_parse_uri.log: test_parse_uri$(EXEEXT) + @p='test_parse_uri$(EXEEXT)'; \ + b='test_parse_uri'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ @@ -2189,6 +2217,8 @@ -rm -f test/$(DEPDIR)/test_init.Po -rm -f test/$(DEPDIR)/test_list.Po -rm -f test/$(DEPDIR)/test_log.Po + -rm -f test/$(DEPDIR)/test_parse_uri.Po + -rm -f test/$(DEPDIR)/test_parse_uri_impl.Po -rm -f test/$(DEPDIR)/test_url.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ @@ -2288,6 +2318,8 @@ -rm -f test/$(DEPDIR)/test_init.Po -rm -f test/$(DEPDIR)/test_list.Po -rm -f test/$(DEPDIR)/test_log.Po + -rm -f test/$(DEPDIR)/test_parse_uri.Po + -rm -f test/$(DEPDIR)/test_parse_uri_impl.Po -rm -f test/$(DEPDIR)/test_url.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libupnp-1.18.4/upnp/src/api/UpnpString.c new/libupnp-1.18.5/upnp/src/api/UpnpString.c --- old/libupnp-1.18.4/upnp/src/api/UpnpString.c 2026-03-27 19:26:03.000000000 +0100 +++ new/libupnp-1.18.5/upnp/src/api/UpnpString.c 2026-04-22 21:28:40.000000000 +0200 @@ -42,7 +42,7 @@ #endif /* _WIN32 */ /* strndup() is a GNU extension. */ -#if !HAVE_STRNDUP || defined(_WIN32) +#if !HAVE_STRNDUP static char *strndup(const char *__string, size_t __n) { size_t strsize = strnlen(__string, __n); @@ -55,7 +55,7 @@ return newstr; } -#endif /* HAVE_STRNDUP && !defined(_WIN32) */ +#endif /* !HAVE_STRNDUP */ /*! * \brief Internal implementation of the class UpnpString. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libupnp-1.18.4/upnp/src/genlib/net/uri/uri.c new/libupnp-1.18.5/upnp/src/genlib/net/uri/uri.c --- old/libupnp-1.18.4/upnp/src/genlib/net/uri/uri.c 2026-03-27 19:26:03.000000000 +0100 +++ new/libupnp-1.18.5/upnp/src/genlib/net/uri/uri.c 2026-04-22 21:28:40.000000000 +0200 @@ -36,6 +36,14 @@ * \brief Contains functions for uri, url parsing utility. */ +#include "config.h" // IWYU pragma: keep + +#include "posix_overwrites.h" // IWYU pragma: keep +#include "upnpapi.h" +#include "uri.h" + +#include <assert.h> + #ifdef __FreeBSD__ #include <osreldate.h> #if __FreeBSD_version < 601103 @@ -47,13 +55,6 @@ #define snprintf _snprintf #endif #endif -#include <assert.h> - -#include "config.h" -#include "upnpapi.h" -#include "uri.h" - -#include "posix_overwrites.h" // IWYU pragma: keep /*! * \brief Returns a 1 if a char is a RESERVED char as defined in @@ -318,8 +319,8 @@ char *c; struct sockaddr_in *sai4 = (struct sockaddr_in *)&out->IPaddress; struct sockaddr_in6 *sai6 = (struct sockaddr_in6 *)&out->IPaddress; - char *srvname = NULL; - char *srvport = NULL; + char *srv_name = NULL; + char *srv_port = NULL; char *last_dot = NULL; unsigned short int port; int af = AF_UNSPEC; @@ -334,13 +335,13 @@ c = workbuf; if (*c == '[') { /* IPv6 addresses are enclosed in square brackets. */ - srvname = ++c; + srv_name = ++c; while (*c != '\0' && *c != ']') c++; if (*c == '\0') /* did not find closing bracket. */ return UPNP_E_INVALID_URL; - /* NULL terminate the srvname and then increment c. */ + /* NULL terminate the srv_name and then increment c. */ *c++ = '\0'; /* overwrite the ']' */ if (*c == ':') { has_port = 1; @@ -349,7 +350,7 @@ af = AF_INET6; } else { /* IPv4 address -OR- host name. */ - srvname = c; + srv_name = c; while (*c != ':' && *c != '/' && (isalnum(*c) || *c == '.' || *c == '-')) { if (*c == '.') @@ -357,7 +358,7 @@ c++; } has_port = (*c == ':') ? 1 : 0; - /* NULL terminate the srvname */ + /* NULL terminate the srv_name */ *c = '\0'; if (has_port == 1) c++; @@ -372,7 +373,7 @@ hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; - ret = getaddrinfo(srvname, NULL, &hints, &res0); + ret = getaddrinfo(srv_name, NULL, &hints, &res0); if (ret == 0) { for (res = res0; res; res = res->ai_next) { switch (res->ai_family) { @@ -400,13 +401,19 @@ /* Check if a port is specified. */ if (has_port == 1) { /* Port is specified. */ - srvport = c; - while (*c != '\0' && isdigit(*c)) + srv_port = c; + while (*c != '\0' && isdigit(*c)) { c++; - port = (unsigned short int)atoi(srvport); - if (port == 0) + } + long port_l = strtol(srv_port, NULL, 10); + if (port_l <= 0 || port_l > 65535) { + return UPNP_E_INVALID_URL; + } + port = (unsigned short int)atoi(srv_port); + if (port == 0) { /* Bad port number. */ return UPNP_E_INVALID_URL; + } } else /* Port was not specified, use default port. */ port = defaultPort; @@ -418,13 +425,13 @@ case AF_INET: sai4->sin_family = (sa_family_t)af; sai4->sin_port = htons(port); - ret = inet_pton(AF_INET, srvname, &sai4->sin_addr); + ret = inet_pton(AF_INET, srv_name, &sai4->sin_addr); break; case AF_INET6: sai6->sin6_family = (sa_family_t)af; sai6->sin6_port = htons(port); sai6->sin6_scope_id = gIF_INDEX; - ret = inet_pton(AF_INET6, srvname, &sai6->sin6_addr); + ret = inet_pton(AF_INET6, srv_name, &sai6->sin6_addr); break; default: /* IP address was set by the hostname (getaddrinfo). */ @@ -450,7 +457,7 @@ * * (e.g. "http:" -> scheme= "http"). * - * \note String MUST include ':' within the max charcters. + * \note String MUST include ':' within the max characters. * * \return */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libupnp-1.18.4/upnp/src/inc/uri.h new/libupnp-1.18.5/upnp/src/inc/uri.h --- old/libupnp-1.18.4/upnp/src/inc/uri.h 2026-03-27 19:26:03.000000000 +0100 +++ new/libupnp-1.18.5/upnp/src/inc/uri.h 2026-04-22 21:28:40.000000000 +0200 @@ -106,7 +106,7 @@ #endif /*! - * \brief Buffer used in parsinghttp messages, urls, etc. generally this simply + * \brief Buffer used in parsing http messages, urls, etc. generally this simply * holds a pointer into a larger array. */ typedef struct TOKEN diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libupnp-1.18.4/upnp/test/CMakeLists.txt new/libupnp-1.18.5/upnp/test/CMakeLists.txt --- old/libupnp-1.18.4/upnp/test/CMakeLists.txt 2026-03-27 19:26:03.000000000 +0100 +++ new/libupnp-1.18.5/upnp/test/CMakeLists.txt 2026-04-22 21:28:40.000000000 +0200 @@ -1,4 +1,54 @@ -upnp_addunittest(test-upnp-list test_list.c) -upnp_addunittest(test-upnp-init test_init.c) -upnp_addunittest(test-upnp-log test_log.c) -upnp_addunittest(test-upnp-url test_url.c) +UPNP_Add_Unit_Test(test-upnp-list test_list.c) +UPNP_Add_Unit_Test(test-upnp-init test_init.c) +UPNP_Add_Unit_Test(test-upnp-log test_log.c) +UPNP_Add_Unit_Test(test-upnp-url test_url.c) + +if(UPNP_BUILD_SHARED) + add_executable( + test-upnp-parse-uri + test_parse_uri.c + test_parse_uri_impl.c + ) + target_link_libraries(test-upnp-parse-uri PRIVATE upnp_shared) + target_include_directories( + test-upnp-parse-uri + PRIVATE ${PUPNP_BINARY_DIR} + PRIVATE ${PUPNP_BINARY_DIR}/upnp/inc + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../inc + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../src/inc + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../src/threadutil + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../ixml/inc + ) + if(HAVE_MACRO_PREFIX_MAP) + target_compile_options( + test-upnp-parse-uri + PRIVATE -fmacro-prefix-map=${CMAKE_SOURCE_DIR}/=. + ) + endif() + add_test(NAME test-upnp-parse-uri COMMAND test-upnp-parse-uri) +endif() + +if(UPNP_BUILD_STATIC) + add_executable( + test-upnp-parse-uri-static + test_parse_uri.c + test_parse_uri_impl.c + ) + target_link_libraries(test-upnp-parse-uri-static PRIVATE upnp_static) + target_include_directories( + test-upnp-parse-uri-static + PRIVATE ${PUPNP_BINARY_DIR} + PRIVATE ${PUPNP_BINARY_DIR}/upnp/inc + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../inc + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../src/inc + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../src/threadutil + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../ixml/inc + ) + if(HAVE_MACRO_PREFIX_MAP) + target_compile_options( + test-upnp-parse-uri-static + PRIVATE -fmacro-prefix-map=${CMAKE_SOURCE_DIR}/=. + ) + endif() + add_test(NAME test-upnp-parse-uri-static COMMAND test-upnp-parse-uri-static) +endif() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libupnp-1.18.4/upnp/test/test_parse_uri.c new/libupnp-1.18.5/upnp/test/test_parse_uri.c --- old/libupnp-1.18.4/upnp/test/test_parse_uri.c 1970-01-01 01:00:00.000000000 +0100 +++ new/libupnp-1.18.5/upnp/test/test_parse_uri.c 2026-04-22 21:28:40.000000000 +0200 @@ -0,0 +1,75 @@ +#define UPNP_DEBUG_C + +#include "ithread.h" +#include "upnp.h" +#include "upnpdebug.h" +#include "uri.h" + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +/* parse_hostport() in uri.c uses this global for IPv6 scope IDs. */ +unsigned gIF_INDEX = (unsigned)-1; +ithread_rwlock_t GlobalHndRWLock; + +void UpnpPrintf(Upnp_LogLevel DLevel, + Dbg_Module Module, + const char *DbgFileName, + int DbgLineNo, + const char *FmtStr, + ...) +{ + (void)DLevel; + (void)Module; + (void)DbgFileName; + (void)DbgLineNo; + (void)FmtStr; +} + +struct test_case +{ + const char *uri; + int expected; + int line; +}; + +#define TEST_INVALID_PORT(URI_VALUE) \ + {.uri = URI_VALUE, .expected = UPNP_E_INVALID_URL, .line = __LINE__} + +static int run_test(const struct test_case *tc) +{ + uri_type parsed; + int ret = parse_uri(tc->uri, strlen(tc->uri), &parsed); + + if (ret == tc->expected) { + return 0; + } + + printf("%s:%d parse_uri('%s') returned %d, expected %d\n", + __FILE__, + tc->line, + tc->uri, + ret, + tc->expected); + return 1; +} + +int main(void) +{ + int i; + int failures = 0; + static const struct test_case tests[] = { + TEST_INVALID_PORT("http://127.0.0.1:65536/"), + TEST_INVALID_PORT("http://127.0.0.1:65537/"), + TEST_INVALID_PORT("http://127.0.0.1:131073/"), + TEST_INVALID_PORT("http://127.0.0.1:-1/"), + TEST_INVALID_PORT("http://127.0.0.1:-65535/"), + }; + + for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { + failures += run_test(&tests[i]); + } + + return failures ? EXIT_FAILURE : EXIT_SUCCESS; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libupnp-1.18.4/upnp/test/test_parse_uri_impl.c new/libupnp-1.18.5/upnp/test/test_parse_uri_impl.c --- old/libupnp-1.18.4/upnp/test/test_parse_uri_impl.c 1970-01-01 01:00:00.000000000 +0100 +++ new/libupnp-1.18.5/upnp/test/test_parse_uri_impl.c 2026-04-22 21:28:40.000000000 +0200 @@ -0,0 +1,13 @@ +/* + * This wrapper intentionally builds uri.c into the test binary. + * + * Why this exists: + * - parse_uri() is internal (declared in upnp/src/inc/uri.h), not part of + * the public Upnp* API that unit tests usually exercise via libupnp. + * - Shared-library builds do not reliably export parse_uri(), so a test that + * only links with libupnp may not resolve this symbol. + * - Compiling uri.c through a test-local translation unit avoids autotools + * object/dependency naming conflicts while keeping the library API surface + * unchanged. + */ +#include "../src/genlib/net/uri/uri.c"
