forked from mirrors/tftp-hpa-google
Applying Arch Linux Patch
a70146278f/tftp-hpa-0.49-fortify-strcpy-crash.patch
This commit is contained in:
parent
2c86ff58dc
commit
37ac880897
1 changed files with 7 additions and 6 deletions
13
tftp/tftp.c
13
tftp/tftp.c
|
@ -278,15 +278,16 @@ makerequest(int request, const char *name,
|
|||
struct tftphdr *tp, const char *mode)
|
||||
{
|
||||
char *cp;
|
||||
size_t len;
|
||||
|
||||
tp->th_opcode = htons((u_short) request);
|
||||
cp = (char *)&(tp->th_stuff);
|
||||
strcpy(cp, name);
|
||||
cp += strlen(name);
|
||||
*cp++ = '\0';
|
||||
strcpy(cp, mode);
|
||||
cp += strlen(mode);
|
||||
*cp++ = '\0';
|
||||
len = strlen(name) + 1;
|
||||
memcpy(cp, name, len);
|
||||
cp += len;
|
||||
len = strlen(mode) + 1;
|
||||
memcpy(cp, mode, len);
|
||||
cp += len;
|
||||
return (cp - (char *)tp);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue