Bugs item #1715392, was opened at 2007-05-09 04:34
Message generated for change (Settings changed) made by bagder
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1715392&group_id=976
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
>Category: TFTP
Group: crash
Status: Open
Resolution: None
>Priority: 6
Private: No
Submitted By: Feng Tu (ayanamixp)
Assigned to: Daniel Stenberg (bagder)
Summary: TFTP catches float point exception with "--connect-timeout"
Initial Comment:
When the option "--connect-timeout" is followed by the number less than 5, Curl will catches float point exception.
You can type the command as followings:
$ curl tftp://%HOSTIP:%TFTPPORT/1.txt --connect-timeout 1
You will get an error like this:
Floating point exception
We find the reason causing this defect:
In function "tftp_set_timeouts" of the file "lib/tftp.c"
================================================
state->retry_max = timeout/5;
/* Compute the re-start interval to suit the timeout */
state->retry_time = timeout/state->retry_max;
================================================
When variant "timeout" is less than 5, we will get an arithmetic expression of which denominator is zero!!
Kenerl will send signal "SIGFPE" and terminate program.
I think we can solve this defect by adding
================================================
state->retry_max = timeout/5;
+ if ( state->retry_max < 1 ){
+ state->retry_max = 1;
+ }
/* Compute the re-start interval to suit the timeout */
state->retry_time = timeout/state->retry_max;
================================================
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1715392&group_id=976
Received on 2007-05-17