Project

General

Profile

Actions

Bug #4952

closed

dladm_range2strs iterates too far

Added by Robert Mustacchi over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Category:
lib - userland libraries
Start date:
2014-07-01
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
External Bug:

Description

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 '<'.

Actions

Also available in: Atom PDF