star/star-1.5.2-bufferoverflow.patch
Petr Šabata 7cb49c7a47 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/star#d4863d5edcd5147d2ee87a8f2c264264c33175aa
2020-10-26 18:05:30 +01:00

23 lines
676 B
Diff

diff --git a/star/longnames.c b/star/longnames.c
index 33cbe2a..9d2e303 100644
--- a/star/longnames.c
+++ b/star/longnames.c
@@ -155,7 +155,7 @@ name_to_tcb(info, ptb)
if (add)
strcatl(ptb->ndbuf.t_name, name, "/", (char *)NULL);
else
- strcpy(ptb->ndbuf.t_name, name);
+ strncpy(ptb->ndbuf.t_name, name, props.pr_maxsname);
return (TRUE);
}
@@ -198,7 +198,7 @@ name_to_tcb(info, ptb)
if (add)
strcatl(ptb->ndbuf.t_name, &np[1], "/", (char *)NULL);
else
- strcpy(ptb->ndbuf.t_name, &np[1]);
+ strncpy(ptb->ndbuf.t_name, &np[1], props.pr_maxsname);
strncpy(ptb->dbuf.t_prefix, name, np - name);
info->f_flags |= F_SPLIT_NAME;
return (TRUE);