[packages/dot1ag-utils] Rel 3
arekm
arekm at pld-linux.org
Thu May 21 15:17:38 CEST 2026
commit b298b141fae2e5f079a3724655ebdc7288ab3e25
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Thu May 21 15:17:22 2026 +0200
Rel 3
dot1ag-utils-strncpy.patch | 26 ++++++++++++++++++++++++++
dot1ag-utils.spec | 4 +++-
2 files changed, 29 insertions(+), 1 deletion(-)
---
diff --git a/dot1ag-utils.spec b/dot1ag-utils.spec
index 053c67a..95a9b3f 100644
--- a/dot1ag-utils.spec
+++ b/dot1ag-utils.spec
@@ -2,11 +2,12 @@ Summary: IEEE 802.1ag (Ethernet OAM) protocol implementation
Summary(pl.UTF-8): Implementacja protokołu IEEE 802.1ag (Ethernet OAM)
Name: dot1ag-utils
Version: 1.0.1
-Release: 2
+Release: 3
License: BSD-like
Group: Networking/Admin
Source0: https://svn.surfnet.nl/trac/dot1ag-utils/export/121/tags/1.0.1/%{name}-%{version}.tar.gz
# Source0-md5: de3c6b8d6d36ed938f7bbbb95b2c77e2
+Patch0: %{name}-strncpy.patch
URL: https://svn.surfnet.nl/trac/dot1ag-utils/wiki
BuildRequires: libpcap-devel
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -38,6 +39,7 @@ komunikatów sprawdzania ciągłości jest wykonywane przez dot1ag_ccd.
%prep
%setup -q
+%patch -P0 -p1
%build
%configure
diff --git a/dot1ag-utils-strncpy.patch b/dot1ag-utils-strncpy.patch
new file mode 100644
index 0000000..eefc8ea
--- /dev/null
+++ b/dot1ag-utils-strncpy.patch
@@ -0,0 +1,26 @@
+--- dot1ag-utils-1.0.1/src/dot1ag_ccd.c.orig 2012-12-21 14:16:46.000000000 +0100
++++ dot1ag-utils-1.0.1/src/dot1ag_ccd.c 2026-05-21 01:15:31.326219019 +0200
+@@ -539,8 +539,9 @@
+ fprintf(stderr, "illegal MD Name Length: %d\n", mdnl);
+ break;
+ }
+- /* copy MD Name to buffer, ensuring trailing '\0' */
+- strncpy(mdnamebuf, (char *) md_namep, mdnl);
++ /* copy MD Name to buffer; mdnl <= DOT1AG_MAX_MD_LENGTH and
++ * mdnamebuf is DOT1AG_MAX_MD_LENGTH+1 zero-filled, so this fits */
++ memcpy(mdnamebuf, md_namep, mdnl);
+
+ if (verbose) {
+ fprintf(stderr, ", MD \"%s\"", mdnamebuf);
+@@ -604,8 +605,9 @@
+ smanl = MAID_SIZE - mdnl - 4;
+ }
+
+- /* copy Short MA Name to buffer */
+- strncpy(smanamebuf, (char *) (md_namep + mdnl + 2), smanl);
++ /* copy Short MA Name to buffer; smanl is clamped to MAID_SIZE - mdnl - 4
++ * and smanamebuf is (MAID_SIZE - mdnl - 4 + 1) zero-filled */
++ memcpy(smanamebuf, md_namep + mdnl + 2, smanl);
+
+ if (verbose) {
+ fprintf(stderr, ", MA \"%s\"", smanamebuf);
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/dot1ag-utils.git/commitdiff/b298b141fae2e5f079a3724655ebdc7288ab3e25
More information about the pld-cvs-commit
mailing list