dladm_range2strs iterates too far
lib - userland libraries
The libdladm function dladm_range2strs is using the wrong bounds check on mpr_count. Today it uses '<='; however, we're starting from zero, not 1. And in fact, when using a mac_propval_range_t consisting of uint32_t ranges, they always start at index zero. This can cause a program to dump core if it has only allocated enough memory for the function equal to the number of ranges. The fix, is simple, we just need to change the check to match the others here to use '<'.
Updated by Electric Monk over 8 years ago
- Status changed from New to Closed
- % Done changed from 90 to 100
git commit 094fb5ac4320eb03177ab15962c69564b1d75733
commit 094fb5ac4320eb03177ab15962c69564b1d75733 Author: Robert Mustacchi <email@example.com> Date: 2014-07-02T15:22:26.000Z 4952 dladm_range2strs iterates too far Reviewed by: Dan McDonald <firstname.lastname@example.org> Reviewed by: Joshua M. Clulow <email@example.com> Approved by: Garrett D'Amore <firstname.lastname@example.org>