Prevent block counter rollover

This commit is contained in:
Joseph C. Lehner 2019-04-29 10:51:38 +02:00
parent 826ff59150
commit 49b156879a

5
tftp.c
View file

@ -400,9 +400,8 @@ int tftp_put(struct nmrpd_args *args)
if (timeouts || ackblock == block) {
if (!timeouts) {
if (++block == 0) {
// rollover; skip to block 1
block = 1;
if (block < UINT16_MAX) {
++block;
}
pkt_mknum(tx, DATA);