blob: 08d2b5b7d62aca36db44819d213cff3180f1d637 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001Patch originally from Fedora
2
3http://pkgs.fedoraproject.org/cgit/tftp.git/
4
5Upstream-Status: Pending
6
7diff -urN tftp-hpa-0.49.orig/tftp/tftp.c tftp-hpa-0.49/tftp/tftp.c
8--- tftp-hpa-0.49.orig/tftp/tftp.c 2008-10-20 18:08:31.000000000 -0400
9+++ tftp-hpa-0.49/tftp/tftp.c 2009-08-05 09:47:18.072585848 -0400
10@@ -279,15 +279,16 @@
11 struct tftphdr *tp, const char *mode)
12 {
13 char *cp;
14+ size_t len;
15
16 tp->th_opcode = htons((u_short) request);
17 cp = (char *)&(tp->th_stuff);
18- strcpy(cp, name);
19- cp += strlen(name);
20- *cp++ = '\0';
21- strcpy(cp, mode);
22- cp += strlen(mode);
23- *cp++ = '\0';
24+ len = strlen(name) + 1;
25+ memcpy(cp, name, len);
26+ cp += len;
27+ len = strlen(mode) + 1;
28+ memcpy(cp, mode, len);
29+ cp += len;
30 return (cp - (char *)tp);
31 }
32