Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package smtpping for openSUSE:Factory checked in at 2026-07-28 18:18:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/smtpping (Old) and /work/SRC/openSUSE:Factory/.smtpping.new.2004 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "smtpping" Tue Jul 28 18:18:44 2026 rev:4 rq:1368171 version:1.1.5 Changes: -------- --- /work/SRC/openSUSE:Factory/smtpping/smtpping.changes 2025-03-24 13:31:26.737809809 +0100 +++ /work/SRC/openSUSE:Factory/.smtpping.new.2004/smtpping.changes 2026-07-28 18:20:45.436499084 +0200 @@ -1,0 +2,9 @@ +Tue Jul 28 08:18:43 UTC 2026 - Martin Hauke <[email protected]> + +- Update to version 1.1.5 + * Require CMake 3.5 policy version. + * Fix undeterminate values and return. + * Fix utility robustness. + * Harden DNS response parser against malformed replies. + +------------------------------------------------------------------- Old: ---- smtpping-1.1.4.tar.gz New: ---- smtpping-1.1.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ smtpping.spec ++++++ --- /var/tmp/diff_new_pack.8Q9KwH/_old 2026-07-28 18:20:46.392532443 +0200 +++ /var/tmp/diff_new_pack.8Q9KwH/_new 2026-07-28 18:20:46.392532443 +0200 @@ -1,8 +1,8 @@ # # spec file for package smtpping # -# Copyright (c) 2021 SUSE LLC -# Copyright (c) 2017-2021, Martin Hauke <[email protected]> +# Copyright (c) 2026 SUSE LLC and contributors +# Copyright (c) 2017-2026, Martin Hauke <[email protected]> # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ Name: smtpping -Version: 1.1.4 +Version: 1.1.5 Release: 0 Summary: A tool for measuring SMTP server delay, delay variation and throughput License: GPL-2.0-only @@ -36,8 +36,7 @@ %build %cmake \ - -DMAN_INSTALL_DIR="%{_mandir}" \ - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 + -DMAN_INSTALL_DIR="%{_mandir}" %install %cmake_install ++++++ smtpping-1.1.4.tar.gz -> smtpping-1.1.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smtpping-1.1.4/CMakeLists.txt new/smtpping-1.1.5/CMakeLists.txt --- old/smtpping-1.1.4/CMakeLists.txt 2021-11-03 01:06:35.000000000 +0100 +++ new/smtpping-1.1.5/CMakeLists.txt 2026-07-28 01:21:07.000000000 +0200 @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +CMAKE_MINIMUM_REQUIRED(VERSION 3.5...4.0) PROJECT(smtpping) SET(TARGET_NAME "smtpping") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smtpping-1.1.4/resolver.cpp new/smtpping-1.1.5/resolver.cpp --- old/smtpping-1.1.4/resolver.cpp 2021-11-03 01:06:35.000000000 +0100 +++ new/smtpping-1.1.5/resolver.cpp 2026-07-28 01:21:07.000000000 +0200 @@ -177,6 +177,10 @@ return false; } + /* a valid response must at least contain the fixed header */ + if (len < HFIXEDSZ) + return false; + header = (HEADER*)&response; resData = (unsigned char*)&response + HFIXEDSZ; resEnd = (unsigned char*)&response + len; @@ -188,27 +192,47 @@ if ((len = dn_skipname(resData, resEnd)) < 0) return false; - resData += len + QFIXEDSZ; + resData += len; + /* each question is followed by QTYPE + QCLASS */ + if (resData + QFIXEDSZ > resEnd) + return false; + resData += QFIXEDSZ; } char buf[MAXDNAME + 1]; for (int i = 0; i < answer_count; i++) { len = dn_expand((unsigned char*)&response, resEnd, resData, (char*)&buf, sizeof buf - 1); - if (len < 0) + if (len < 0) return false; resData += len; + /* fixed RR header: TYPE(2) + CLASS(2) + TTL(4) + RDLENGTH(2) */ + if (resData + 3 * INT16SZ + INT32SZ > resEnd) + return false; + GETSHORT(rec_type, resData); resData += INT16SZ + INT32SZ; GETSHORT(rec_len, resData); + /* the record data must lie within the response buffer */ + if (rec_len > resEnd - resData) + return false; + + /* parse rdata through a separate cursor so that advancing + resData below always uses the untouched RDLENGTH */ + unsigned char* rdata = resData; + unsigned short rdata_len = rec_len; + switch(rec_type) { case T_MX: - GETSHORT(rec_pref, resData); - rec_len -= sizeof(short); + /* MX rdata is PREFERENCE(2) + exchange name */ + if (rdata_len < INT16SZ) + return false; + GETSHORT(rec_pref, rdata); + rdata_len -= INT16SZ; break; default: rec_pref = 0; @@ -219,31 +243,32 @@ switch(rec_type) { case T_A: + if (rdata_len >= sizeof(struct in_addr)) { - char buf[INET_ADDRSTRLEN]; + char abuf[INET_ADDRSTRLEN]; if (inet_ntop(AF_INET, - (const struct sockaddr_in*)resData, buf, INET_ADDRSTRLEN)) { - prioMap[rec_pref].push_back(buf); + rdata, abuf, sizeof abuf)) { + prioMap[rec_pref].push_back(abuf); } } break; case T_AAAA: + if (rdata_len >= sizeof(struct in6_addr)) { - char buf[INET6_ADDRSTRLEN]; + char abuf[INET6_ADDRSTRLEN]; if (inet_ntop(AF_INET6, - (const struct sockaddr_in6*)resData, buf, INET6_ADDRSTRLEN)) { - prioMap[rec_pref].push_back(buf); + rdata, abuf, sizeof abuf)) { + prioMap[rec_pref].push_back(abuf); } } break; case T_MX: { - char buf[MAXDNAME + 1]; - len = dn_expand((unsigned char*)&response, resEnd, resData, (char*)&buf, sizeof buf - 1); - if (len < 0) + char mbuf[MAXDNAME + 1]; + if (dn_expand((unsigned char*)&response, resEnd, rdata, (char*)&mbuf, sizeof mbuf - 1) < 0) return false; - prioMap[rec_pref].push_back(buf); + prioMap[rec_pref].push_back(mbuf); } break; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smtpping-1.1.4/resolver.hpp new/smtpping-1.1.5/resolver.hpp --- old/smtpping-1.1.4/resolver.hpp 2021-11-03 01:06:35.000000000 +0100 +++ new/smtpping-1.1.5/resolver.hpp 2026-07-28 01:21:07.000000000 +0200 @@ -59,7 +59,9 @@ bool Lookup(const std::string& domain, RecordType recordType, std::vector<std::string>& result); int GetLastError() const { -#ifndef __WIN32__ +#ifdef __WIN32__ + return -1; +#else return m_res.res_h_errno; #endif } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smtpping-1.1.4/smtpping.cpp new/smtpping-1.1.5/smtpping.cpp --- old/smtpping-1.1.4/smtpping.cpp 2021-11-03 01:06:35.000000000 +0100 +++ new/smtpping-1.1.5/smtpping.cpp 2026-07-28 01:21:07.000000000 +0200 @@ -58,14 +58,14 @@ */ bool debug = false; -#define APP_VERSION "1.1.4" +#define APP_VERSION "1.1.5" #define APP_NAME "smtpping" /* * Signal Handlers (abort ping and show statistics) */ bool abort_ping = false; -void abort(int) +void sigint_handler(int) { abort_ping = true; signal(SIGINT, SIG_DFL); @@ -85,18 +85,21 @@ int r; do { r = recv(s, buf, sizeof buf, MSG_NOSIGNAL); - if (r > 0) cmd += buf[0]; - if (buf[0] == '\n') + if (r > 0) { - if (debug) - fprintf(stderr, "response %s", cmd.c_str()); - /* support multi-line responses */ - if (cmd.size() > 4 && cmd[3] == ' ') + cmd += buf[0]; + if (buf[0] == '\n') { - ret = strtoul(cmd.substr(0, 3).c_str(), NULL, 10); - return true; - } else - cmd.clear(); + if (debug) + fprintf(stderr, "response %s", cmd.c_str()); + /* support multi-line responses */ + if (cmd.size() > 4 && cmd[3] == ' ') + { + ret = strtoul(cmd.substr(0, 3).c_str(), NULL, 10); + return true; + } else + cmd.clear(); + } } } while(r > 0); return false; @@ -189,7 +192,7 @@ int main(int argc, char* argv[]) { /* register signal handlers */ - signal(SIGINT, abort); + signal(SIGINT, sigint_handler); #ifdef __WIN32__ /* initialize winsock */ @@ -439,9 +442,13 @@ #ifdef SUPPORT_RATE sem_t* sem = (sem_t*)mmap(NULL, sizeof(sem_t), PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0); + size_t* counter = (size_t*)mmap(NULL, sizeof(size_t), PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0); + if (sem == MAP_FAILED || counter == MAP_FAILED) { + fprintf(stderr, "mmap: failed\n"); + return 1; + } if (sem_init(sem, 1, 1) != 0) fprintf(stderr, "sem_init: failed\n"); - size_t* counter = (size_t*)mmap(NULL, sizeof(size_t), PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0); *counter = 0; #else if (show_rate) { @@ -461,6 +468,8 @@ pid = fork(); if (pid == 0) goto spawn; + if (pid < 0) + fprintf(stderr, "fork() failed\n"); } #ifdef SUPPORT_RATE while (show_rate && !abort_ping) { @@ -635,7 +644,7 @@ * < SMTP Banner */ string cmd; - size_t ret; + size_t ret = 0; if (!SMTPReadLine(s, ret) || ret / 100 != 2) { fprintf(stderr, "seq=%u: recv: BANNER failed (%zu)\n",
