https://bugs.openldap.org/show_bug.cgi?id=9191
Bug ID: 9191 Summary: libraries\liblutil\meter.c have a bad function lutil_meter_update, maybe divide 0 Product: OpenLDAP Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: --- Component: client tools Assignee: bugs@openldap.org Reporter: digpython@163.com Target Milestone: ---
int lutil_meter_update ( lutil_meter_t *meter, size_t position, int force) { static const double display_rate = 0.5; double frac, cycle_length, speed, now; time_t remaining_time, elapsed; int rc;
assert( meter != NULL );
lutil_get_now( &now );
if ( !force && now - meter->last_update < display_rate ) return 0;
frac = ((double)position) / ((double) meter->goal_value); elapsed = now - meter->start_time; if (frac <= 0.0) return 0; if (frac >= 1.0) { rc = meter->display->display_update( &meter->display_data, 1.0, 0, (time_t) elapsed, ((double)position) / elapsed); } else { ... }
https://bugs.openldap.org/show_bug.cgi?id=9191
--- Comment #1 from Quanah Gibson-Mount quanah@openldap.org --- Hi,
Can you expand here with an example, etc?
Thanks.
https://bugs.openldap.org/show_bug.cgi?id=9191
--- Comment #2 from digpython@163.com --- (In reply to Quanah Gibson-Mount from comment #1)
Hi,
Can you expand here with an example, etc?
Thanks.
i hava call slapadd, happend divide 0,
at the function lutil_meter_update's statement:
elapsed = now - meter->start_time;
the elapsed is 0
https://bugs.openldap.org/show_bug.cgi?id=9191
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |OL_2_5_REQ Target Milestone|--- |2.5.0
https://bugs.openldap.org/show_bug.cgi?id=9191
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords|OL_2_5_REQ | Resolution|--- |TEST Status|UNCONFIRMED |RESOLVED
--- Comment #3 from Quanah Gibson-Mount quanah@openldap.org --- Commits: • 06688778 by Quanah Gibson-Mount at 2020-04-06T15:42:00+00:00 ITS#9191 - Avoid div 0 error
https://bugs.openldap.org/show_bug.cgi?id=9191
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |VERIFIED Resolution|TEST |FIXED