Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libnpupnp for openSUSE:Factory checked in at 2026-11-16 09:08:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libnpupnp (Old) and /work/SRC/openSUSE:Factory/.libnpupnp.new.1251 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libnpupnp" Mon Nov 16 09:08:08 2026 rev:12 rq:1397557 version:6.3.1 Changes: -------- --- /work/SRC/openSUSE:Factory/libnpupnp/libnpupnp.changes 2026-03-27 06:43:23.746842000 +0100 +++ /work/SRC/openSUSE:Factory/.libnpupnp.new.1251/libnpupnp.changes 2026-11-16 09:13:41.726942206 +0100 @@ -1,0 +2,6 @@ +Sat Nov 14 10:03:43 UTC 2026 - Michael Pujos <[email protected]> + +- Update to version 6.3.1 + * Fix crash when receiving HTTP query with empty parameter + +------------------------------------------------------------------- Old: ---- libnpupnp-6.3.0.tar.gz libnpupnp-6.3.0.tar.gz.asc New: ---- libnpupnp-6.3.1.tar.gz libnpupnp-6.3.1.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libnpupnp.spec ++++++ --- /var/tmp/diff_new_pack.pWMu0F/_old 2026-11-16 09:13:43.906033563 +0100 +++ /var/tmp/diff_new_pack.pWMu0F/_new 2026-11-16 09:13:43.907033605 +0100 @@ -19,7 +19,7 @@ %define so_ver 13 Name: libnpupnp -Version: 6.3.0 +Version: 6.3.1 Release: 0 Summary: A C++ base UPnP library, derived from Portable UPnP, a.k.a libupnp License: BSD-3-Clause ++++++ libnpupnp-6.3.0.tar.gz -> libnpupnp-6.3.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnpupnp-6.3.0/macos/upnpconfig-macos.h new/libnpupnp-6.3.1/macos/upnpconfig-macos.h --- old/libnpupnp-6.3.0/macos/upnpconfig-macos.h 2026-03-20 09:05:06.000000000 +0100 +++ new/libnpupnp-6.3.1/macos/upnpconfig-macos.h 2026-11-13 16:22:49.000000000 +0100 @@ -40,7 +40,7 @@ ***************************************************************************/ /** The library version (string) e.g. "1.3.0" */ -#define NPUPNP_VERSION_STRING "6.3.0" +#define NPUPNP_VERSION_STRING "6.3.1" /** Major version of the library */ #define NPUPNP_VERSION_MAJOR 6 @@ -49,7 +49,7 @@ #define NPUPNP_VERSION_MINOR 3 /** Patch version of the library */ -#define NPUPNP_VERSION_PATCH 0 +#define NPUPNP_VERSION_PATCH 1 /** The library version (numeric) e.g. 10300 means version 1.3.0 */ #define NPUPNP_VERSION \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnpupnp-6.3.0/meson.build new/libnpupnp-6.3.1/meson.build --- old/libnpupnp-6.3.0/meson.build 2026-03-20 09:02:31.000000000 +0100 +++ new/libnpupnp-6.3.1/meson.build 2026-11-13 16:22:38.000000000 +0100 @@ -2,7 +2,7 @@ 'libnpupnp', 'cpp', license: 'BSD-3-Clause', - version: '6.3.0', + version: '6.3.1', default_options: 'cpp_std=c++17', meson_version: '>=0.49', ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnpupnp-6.3.0/src/dispatcher/miniserver.cpp new/libnpupnp-6.3.1/src/dispatcher/miniserver.cpp --- old/libnpupnp-6.3.0/src/dispatcher/miniserver.cpp 2025-11-20 14:32:39.000000000 +0100 +++ new/libnpupnp-6.3.1/src/dispatcher/miniserver.cpp 2026-11-13 16:27:09.000000000 +0100 @@ -119,10 +119,16 @@ } } -static MHD_Result headers_cb(void *cls, enum MHD_ValueKind, const char *k, const char *value) +static std::string makeastring(const char *cp) +{ + return cp ? cp : std::string(); +} + +static MHD_Result headers_cb(void *cls, enum MHD_ValueKind, const char *_key, const char *_value) { auto mhtt = static_cast<MHDTransaction *>(cls); - std::string key(k); + std::string key = makeastring(_key); + std::string value = makeastring(_value); stringtolower(key); // It is always possible to combine multiple identically named headers // name into one comma separated list. See HTTP 1.1 section 4.2 @@ -133,7 +139,7 @@ mhtt->headers[key] = value; } UpnpPrintf(UPNP_DEBUG, MSERV, __FILE__, __LINE__, - "miniserver:req_header: [%s: %s]\n", key.c_str(), value); + "miniserver:req_header: [%s: %s]\n", key.c_str(), value.c_str()); return MHD_YES; } @@ -146,12 +152,16 @@ } static MHD_Result queryvalues_cb(void *cls, enum MHD_ValueKind, - const char *key, const char *value) + const char *_key, const char *_value) { auto mhdt = static_cast<MHDTransaction *>(cls); + + std::string key = makeastring(_key); + std::string value = makeastring(_value); + if (mhdt) { UpnpPrintf(UPNP_ALL, MSERV, __FILE__, __LINE__, - "miniserver:request value: [%s: %s]\n", key, value); + "miniserver:request value: [%s: %s]\n", key.c_str(), value.c_str()); mhdt->queryvalues[key] = value; } return MHD_YES; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnpupnp-6.3.0/src/inc/httputils.h new/libnpupnp-6.3.1/src/inc/httputils.h --- old/libnpupnp-6.3.0/src/inc/httputils.h 2024-12-27 14:21:21.000000000 +0100 +++ new/libnpupnp-6.3.1/src/inc/httputils.h 2026-06-06 14:14:50.000000000 +0200 @@ -67,7 +67,7 @@ * always lower-cased, and lower case is expected by the function */ int httpheader_str2int(const std::string& headername); -std::string query_encode(const std::string& qs); +std::string query_encode(const std::string& qs, bool preserve_slash=false); /* Context for a microhttpd request/response */ struct MHDTransaction { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnpupnp-6.3.0/src/inc/picoxml.h new/libnpupnp-6.3.1/src/inc/picoxml.h --- old/libnpupnp-6.3.0/src/inc/picoxml.h 2026-01-02 19:12:10.000000000 +0100 +++ new/libnpupnp-6.3.1/src/inc/picoxml.h 2026-03-21 08:32:14.000000000 +0100 @@ -1,4 +1,4 @@ -/* Copyright (C) 2016 J.F.Dockes +/* Copyright (C) 2016-2026 J.F.Dockes * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnpupnp-6.3.0/src/utils/httputils.cpp new/libnpupnp-6.3.1/src/utils/httputils.cpp --- old/libnpupnp-6.3.0/src/utils/httputils.cpp 2025-11-19 08:29:43.000000000 +0100 +++ new/libnpupnp-6.3.1/src/utils/httputils.cpp 2026-06-06 14:15:16.000000000 +0200 @@ -442,7 +442,11 @@ return tempbuf; } -std::string query_encode(const std::string& qs) + +// Note: we used to preserve * and encode ~, which is wrong according to newser RFCs (3986). We added +// ~ to the set of unencoded chars, but however kept * because this matches common usage. Ask an +// LLM about the history of * and ~ inside URLs if you want a better explanation. +std::string query_encode(const std::string& qs, bool preserve_slash) { std::string out; out.reserve(qs.size()); @@ -451,7 +455,8 @@ while (*cp) { if ((*cp >= 'A' && *cp <= 'Z') || (*cp >= 'a' && *cp <= 'z') || (*cp >= '0' && *cp <= '9') || - *cp == '*' || *cp == '-' || *cp== '.' || *cp == '_') { + (preserve_slash && *cp == '/') || + *cp == '*' || *cp == '~' || *cp == '-' || *cp== '.' || *cp == '_') { out += *cp; } else { out += '%'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnpupnp-6.3.0/src/utils/smallut.cpp new/libnpupnp-6.3.1/src/utils/smallut.cpp --- old/libnpupnp-6.3.0/src/utils/smallut.cpp 2025-11-01 11:05:08.000000000 +0100 +++ new/libnpupnp-6.3.1/src/utils/smallut.cpp 2026-09-02 08:28:13.000000000 +0200 @@ -129,7 +129,8 @@ } if (wcharcnt + 1 > int(wcharsavail)) { #ifdef LOGERR - LOGERR("utf8towchar: not enough space\n"); + LOGERR("utf8towchar: not enough space: avail " << wcharsavail << + " needed " << wcharcnt << "\n"); #endif return false; } @@ -653,11 +654,10 @@ } -/* Truncate a string to a given maxlength, avoiding cutting off midword - * if reasonably possible. Note: we could also use textsplit, stopping when - * we have enough, this would be cleanly utf8-aware but would remove - * punctuation */ -static const std::string cstr_SEPAR = " \t\n\r-:.;,/[]{}"; +// Truncate a string to a given maxlength, avoiding cutting off midword if reasonably +// possible. Note: we could also use textsplit, stopping when we have enough, this would be cleanly +// utf8-aware but would remove punctuation. +static const std::string cstr_SEPAR = " \t\n\r-:.;,/[]{}_"; std::string truncate_to_word(const std::string& input, std::string::size_type maxlen) { std::string output; @@ -666,12 +666,10 @@ } else { output = input.substr(0, maxlen); std::string::size_type space = output.find_last_of(cstr_SEPAR); - // Original version only truncated at space if space was found after - // maxlen/2. But we HAVE to truncate at space, else we'd need to do - // utf8 stuff to avoid truncating at multibyte char. In any case, - // not finding space means that the text probably has no value. - // Except probably for Asian languages, so we may want to fix this - // one day + // The original version only truncated at space if space was found after maxlen/2. But we + // HAVE to truncate at space, else we'd need to do utf8 stuff to avoid truncating at + // multibyte char. In any case, not finding space means that the text probably has no value. + // Except probably for Asian languages, so we may want to fix this one day if (space == std::string::npos) { output.erase(); } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnpupnp-6.3.0/src/webserver/webserver.cpp new/libnpupnp-6.3.1/src/webserver/webserver.cpp --- old/libnpupnp-6.3.0/src/webserver/webserver.cpp 2025-07-13 09:35:54.000000000 +0200 +++ new/libnpupnp-6.3.1/src/webserver/webserver.cpp 2026-06-06 16:13:20.000000000 +0200 @@ -499,7 +499,7 @@ qs.pop_back(); } std::string bfilename{filename}; - filename += qs; + filename = query_encode(filename, true) + qs; /* get file info */ if (virtualDirCallback.get_info(filename.c_str(), &finfo, entryp->cookie, &RespInstr->request_cookie) != UPNP_E_SUCCESS) { @@ -514,7 +514,7 @@ temp_str = "/index.html"; } bfilename += temp_str; - filename = bfilename + qs; + filename = query_encode(bfilename, true) + qs; /* get info */ if ((virtualDirCallback.get_info(filename.c_str(), &finfo, entryp->cookie, &RespInstr->request_cookie) != UPNP_E_SUCCESS) || diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnpupnp-6.3.0/windows/upnpconfig-windows.h new/libnpupnp-6.3.1/windows/upnpconfig-windows.h --- old/libnpupnp-6.3.0/windows/upnpconfig-windows.h 2026-03-20 09:05:06.000000000 +0100 +++ new/libnpupnp-6.3.1/windows/upnpconfig-windows.h 2026-11-13 16:22:49.000000000 +0100 @@ -40,7 +40,7 @@ ***************************************************************************/ /** The library version (string) e.g. "1.3.0" */ -#define NPUPNP_VERSION_STRING "6.3.0" +#define NPUPNP_VERSION_STRING "6.3.1" /** Major version of the library */ #define NPUPNP_VERSION_MAJOR 6 @@ -49,7 +49,7 @@ #define NPUPNP_VERSION_MINOR 3 /** Patch version of the library */ -#define NPUPNP_VERSION_PATCH 0 +#define NPUPNP_VERSION_PATCH 1 /** The library version (numeric) e.g. 10300 means version 1.3.0 */ #define NPUPNP_VERSION \
