View Issue Details

IDProjectCategoryView StatusLast Update
0003143GNUnettransport servicepublic2013-12-24 19:54
ReporterLRN Assigned ToMatthias Wachs Due Date
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product VersionGit master 
Target Version0.10.0Fixed in Version0.10.0 
Summary0003143: Division by zero in send_utilization_data
Descriptionstruct GNUNET_TIME_Relative delta;

delta = GNUNET_TIME_absolute_get_difference(n->last_util_transmission, GNUNET_TIME_absolute_get());

bps_pl_in = 0;
if (0 != n->util_payload_bytes_recv)
  bps_pl_in = (1000LL * 1000LL * n->util_payload_bytes_recv) / (delta.rel_value_us);
bps_pl_out = 0;

If delta value is zero, the program crashes.
While it might be a bug that the function is called again too soon (practically immediately), it's still a good idea to handle the zero-division case, IMO...
TagsNo tags attached.

Activities

Matthias Wachs

2013-11-28 13:54

reporter   ~0007740

fixed in 30934

Issue History

Date ModifiedUsernameFieldChange
2013-11-28 13:23LRNNew Issue
2013-11-28 13:23LRNStatusnew => assigned
2013-11-28 13:23LRNAssigned To => Matthias Wachs
2013-11-28 13:54Matthias WachsNote Added: 0007740
2013-11-28 13:54Matthias WachsStatusassigned => resolved
2013-11-28 13:54Matthias WachsResolutionopen => fixed
2013-11-28 19:22Christian GrothoffProduct Version => Git master
2013-11-28 19:22Christian GrothoffFixed in Version => 0.10.0
2013-11-28 19:22Christian GrothoffTarget Version => 0.10.0
2013-12-24 19:54Christian GrothoffStatusresolved => closed