iperf icon indicating copy to clipboard operation
iperf copied to clipboard

iperf_api: memset entire malloc

Open RABijl opened this issue 1 year ago • 1 comments

PLEASE NOTE the following text from the iperf3 license. Submitting a pull request to the iperf3 repository constitutes "[making] Enhancements available...publicly":

You are under no obligation whatsoever to provide any bug fixes, patches, or
upgrades to the features, functionality or performance of the source code
("Enhancements") to anyone; however, if you choose to make your Enhancements
available either publicly, or directly to Lawrence Berkeley National
Laboratory, without imposing a separate written license agreement for such
Enhancements, then you hereby grant the following license: a non-exclusive,
royalty-free perpetual license to install, use, modify, prepare derivative
works, incorporate into other computer software, distribute, and sublicense
such enhancements or derivative works thereof, in binary and source code form.

The complete iperf3 license is available in the LICENSE file in the top directory of the iperf3 source tree.

  • Version of iperf3 (or development branch, such as master or 3.1-STABLE) to which this pull request applies:

  • Issues fixed (if any):

  • Brief description of code changes (suitable for use as a commit message): in the function iperf_new_test the bitrate_limit_intervals_traffic_bytes array was only memset for the size of the sizeof return type, instead of the entire array.

while we're on this topic, is there are reason why calloc is not used but instead of malloc + memset?

RABijl avatar Mar 19 '24 17:03 RABijl

Thanks for the PR! Yeah that's a pretty silly bug isn't it.

bmah888 avatar Mar 22 '24 17:03 bmah888