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 #1

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 <rm@joyent.com>
Date:   2014-07-02T15:22:26.000Z

    4952 dladm_range2strs iterates too far
    Reviewed by: Dan McDonald <danmcd@omniti.com>
    Reviewed by: Joshua M. Clulow <josh@sysmgr.org>
    Approved by: Garrett D'Amore <garrett@damore.org>

Actions

Also available in: Atom PDF