From 8fd5ce85f97c5cf196c891b4035ac5fbf0a337bd Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jun 09 2022 08:11:46 +0000 Subject: import nspr-4.34.0-2.el8_6 --- diff --git a/SOURCES/nspr-4.34-fix-coverity-loop-issue.patch b/SOURCES/nspr-4.34-fix-coverity-loop-issue.patch new file mode 100644 index 0000000..c8c4149 --- /dev/null +++ b/SOURCES/nspr-4.34-fix-coverity-loop-issue.patch @@ -0,0 +1,51 @@ +diff --git a/pr/src/misc/prnetdb.c b/pr/src/misc/prnetdb.c +--- a/pr/src/misc/prnetdb.c ++++ b/pr/src/misc/prnetdb.c +@@ -2209,28 +2209,38 @@ PR_GetPrefLoopbackAddrInfo(PRNetAddr *re + PRBool result_still_empty = PR_TRUE; + PRADDRINFO *ai = res; + do { + PRNetAddr aNetAddr; + + while (ai && ai->ai_addrlen > sizeof(PRNetAddr)) + ai = ai->ai_next; + +- if (ai) { +- /* copy sockaddr to PRNetAddr */ +- memcpy(&aNetAddr, ai->ai_addr, ai->ai_addrlen); +- aNetAddr.raw.family = ai->ai_addr->sa_family; ++ if (!ai) { ++ break; ++ } ++ ++ /* copy sockaddr to PRNetAddr */ ++ memcpy(&aNetAddr, ai->ai_addr, ai->ai_addrlen); ++ aNetAddr.raw.family = ai->ai_addr->sa_family; + #ifdef _PR_INET6 +- if (AF_INET6 == aNetAddr.raw.family) +- aNetAddr.raw.family = PR_AF_INET6; ++ if (AF_INET6 == aNetAddr.raw.family) ++ aNetAddr.raw.family = PR_AF_INET6; + #endif +- if (ai->ai_addrlen < sizeof(PRNetAddr)) +- memset(((char*)result)+ai->ai_addrlen, 0, +- sizeof(PRNetAddr) - ai->ai_addrlen); ++ if (ai->ai_addrlen < sizeof(PRNetAddr)) ++ memset(((char*)&aNetAddr)+ai->ai_addrlen, 0, ++ sizeof(PRNetAddr) - ai->ai_addrlen); ++ ++ if (result->raw.family == PR_AF_INET) { ++ aNetAddr.inet.port = htons(port); + } ++ else { ++ aNetAddr.ipv6.port = htons(port); ++ } ++ + + /* If we obtain more than one result, prefer IPv6. */ + if (result_still_empty || aNetAddr.raw.family == PR_AF_INET6) { + memcpy(result, &aNetAddr, sizeof(PRNetAddr)); + } + result_still_empty = PR_FALSE; + ai = ai->ai_next; + } diff --git a/SPECS/nspr.spec b/SPECS/nspr.spec index 8299a33..800d8b7 100644 --- a/SPECS/nspr.spec +++ b/SPECS/nspr.spec @@ -11,7 +11,7 @@ rpm.define(string.format("nspr_archive_version %s", Summary: Netscape Portable Runtime Name: nspr Version: %{nspr_version} -Release: 1%{?dist} +Release: 2%{?dist} License: MPLv2.0 URL: http://ftp.mozilla.org/pub/nspr/releases/v${nspr_archive_version}/src Group: System Environment/Libraries @@ -27,6 +27,8 @@ Source1: nspr-config.xml Patch1: nspr-config-pc.patch Patch2: nspr-gcc-atomics.patch +Patch10: nspr-4.34-fix-coverity-loop-issue.patch + %description NSPR provides platform independence for non-GUI operating system facilities. These facilities include threads, thread synchronization, @@ -59,6 +61,7 @@ cp ./nspr/config/nspr-config.in ./nspr/config/nspr-config-pc.in %patch1 -p0 -b .flags pushd nspr %patch2 -p1 -b .gcc-atomics +%patch10 -p1 -b .coverity popd %build @@ -152,6 +155,9 @@ done %{_mandir}/man*/* %changelog +* Mon Jun 6 2022 Bob Relyea - 4.34.0-2 +- Fix coverify issue in NSPR 4.34 + * Thu Jun 2 2022 Bob Relyea - 4.34.0-1 - Update to NSPR 4.34