ftp/netkit-ftp-0.17-linelen-segfault.patch
Petr Šabata 1666a24e9c RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/ftp#b1415fc448cd0131b94f8c8bcaede3f1eb394460
2020-10-15 00:38:36 +02:00

24 lines
832 B
Diff

diff -up netkit-ftp-0.17/ftp/ftp.c.orig netkit-ftp-0.17/ftp/ftp.c
diff -up netkit-ftp-0.17/ftp/ftp_var.h.orig netkit-ftp-0.17/ftp/ftp_var.h
diff -up netkit-ftp-0.17/ftp/main.c.orig netkit-ftp-0.17/ftp/main.c
--- netkit-ftp-0.17/ftp/main.c.orig 2018-09-03 16:49:16.459000000 +0200
+++ netkit-ftp-0.17/ftp/main.c 2018-09-03 17:00:14.853452345 +0200
@@ -399,7 +399,7 @@ int slrflag;
char **
makeargv(int *pargc, char **parg)
{
- static char *rargv[20];
+ static char *rargv[LINELEN];
int rargc = 0;
char **argp;
@@ -407,7 +407,7 @@ makeargv(int *pargc, char **parg)
stringbase = line; /* scan from first of buffer */
argbase = argbuf; /* store from first of buffer */
slrflag = 0;
- while ((*argp++ = slurpstring())!=NULL)
+ while ((rargc < LINELEN) && (*argp++ = slurpstring())!=NULL)
rargc++;
*pargc = rargc;