mirror of
https://github.com/tio/tio.git
synced 2026-05-01 23:07:58 +02:00
Fix unbounded writes
This commit is contained in:
parent
6ec2ac19d0
commit
be4fc0908f
3 changed files with 3 additions and 11 deletions
|
|
@ -688,7 +688,7 @@ int xymodem_send(int sio, const char *filename, modem_mode_t mode)
|
|||
|
||||
rc = -1;
|
||||
if (strlen(filename) > 977) break; /* hdr block overrun */
|
||||
p = stpcpy(hdr, filename) + 1;
|
||||
p = stpncpy(hdr, filename, 1024) + 1;
|
||||
p += sprintf(p, "%ld %lo %o", len, stat.st_mtime, stat.st_mode);
|
||||
|
||||
if (xmodem_1k(sio, hdr, p - hdr, 0) < 0) break; /* hdr with metadata */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue