aboutsummaryrefslogtreecommitdiff
path: root/lib/tftp.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tftp.c')
-rw-r--r--lib/tftp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/tftp.c b/lib/tftp.c
index 18c9472d3..c203f4fdf 100644
--- a/lib/tftp.c
+++ b/lib/tftp.c
@@ -180,6 +180,10 @@ void tftp_set_timeouts(tftp_state_data_t *state)
/* Average restart after 5 seconds */
state->retry_max = timeout/5;
+ if(state->retry_max < 1)
+ /* avoid division by zero below */
+ state->retry_max = 1;
+
/* Compute the re-start interval to suit the timeout */
state->retry_time = timeout/state->retry_max;
if(state->retry_time<1)