comms/lrzsz: patch CVE-2018-10195

Security: CVE-2018-10195
MFC: 2024Q4
(cherry picked from commit a2e118fa21)
This commit is contained in:
Dirk Meyer 2024-11-08 18:45:36 +01:00
parent f1024bd59c
commit e86680e502
2 changed files with 20 additions and 1 deletions

View file

@ -1,6 +1,6 @@
PORTNAME= lrzsz
PORTVERSION= 0.12.20
PORTREVISION= 6
PORTREVISION= 7
CATEGORIES= comms
MASTER_SITES= http://ohse.de/uwe/releases/

View file

@ -0,0 +1,19 @@
--- src/zm.c.orig 1998-12-29 16:48:38 UTC
+++ src/zm.c
@@ -431,10 +431,12 @@ zsdata(const char *buf, size_t length, int frameend)
VPRINTF(3,("zsdata: %lu %s", (unsigned long) length,
Zendnames[(frameend-ZCRCE)&3]));
crc = 0;
- do {
- zsendline(*buf); crc = updcrc((0377 & *buf), crc);
- buf++;
- } while (--length>0);
+
+ for( ; length; length--) {
+ zsendline(*buf); crc = updcrc((0377 & *buf), crc);
+ buf++;
+ }
+
xsendline(ZDLE); xsendline(frameend);
crc = updcrc(frameend, crc);