Project

General

Profile

Actions

Bug #4922

closed

all calloc() implementations should check for overflow

Added by Rich Lowe almost 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
lib - userland libraries
Start date:
2014-06-12
Due date:
% Done:

100%

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

Description

We have a depressing number of calloc() implementations, only a subset of which check for integer overflow.

The remaining ones, aside from compatibility concerns or futility, should check too. These include mapmalloc, mtmalloc, libmalloc, and the rtld calloc.

Actions #1

Updated by Rich Lowe almost 9 years ago

This leaves libbc, which in general we leave exactly as broken as it always was, given its purpose, and libld_calloc (a macro which just does the multiplication) as not any more worth fixing than every other case where we do malloc(a * b) and don't check overflow -- worth it, but not necessarily worth it now, or piecemeal.

Actions #2

Updated by Electric Monk over 8 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 31c6d826a7f7a4ee7d83c8e99f25d82a4a248076

commit  31c6d826a7f7a4ee7d83c8e99f25d82a4a248076
Author: Richard Lowe <richlowe@richlowe.net>
Date:   2014-07-19T23:07:30.000Z

    4922 all calloc() implementations should check for overflow
    Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
    Reviewed by: Marcel Telka <marcel.telka@nexenta.com>
    Approved by: Dan McDonald <danmcd@omniti.com>

Actions

Also available in: Atom PDF