From: "Dennis Wölfing" <denniswoelfing@gmx.de>
To: libc-alpha@sourceware.org
Subject: Re: [PATCH v3] Add reallocarray function.
Date: Fri, 28 Apr 2017 08:57:00 -0000 [thread overview]
Message-ID: <b19175ac-f141-e0e5-49e8-96da56bfb719@gmx.de> (raw)
In-Reply-To: <20170421121646.28392-1-denniswoelfing@gmx.de>
On 21.04.2017 14:16, Dennis Wölfing wrote:
> The reallocarray function is an extension from OpenBSD. It is an
> integer-overflow-safe replacement for realloc(p, X*Y) and
> malloc(X*Y) (realloc(NULL, X*Y)). It can therefore help in preventing
> certain security issues in code.
>
> This is an updated version of a patch originally submitted by Rüdiger
> Sonderfeld in May 2014.
> See <https://sourceware.org/ml/libc-alpha/2014-05/msg00481.html>.
>
> Tested on x86_64-linux.
>
> 2017-04-21 Dennis Wölfing <denniswoelfing@gmx.de>
> Rüdiger Sonderfeld <ruediger@c-plusplus.de>
>
> * NEWS: Mention addition of reallocarray.
> * malloc/Makefile (routines): Add reallocarray.
> (tests): Add tst-reallocarray.c.
> * malloc/Versions: Add reallocarray and __libc_reallocarray.
> * malloc/malloc-private.h: New file.
> * malloc/malloc.c (__libc_calloc): Use `check_mul_overflow'.
> * malloc/malloc.h (reallocarray): New declaration.
> * stdlib/stdlib.h (reallocarray): Likewise.
> * malloc/reallocarray.c: New file.
> * malloc/tst-reallocarray.c: New test file.
> * manual/memory.texi: Document reallocarray.
> * sysdeps/arm/nacl/libc.abilist: Add reallocarray.
> * sysdeps/unix/sysv/linux/aarch64/libc.abilist: Likewise.
> * sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise.
> * sysdeps/unix/sysv/linux/arm/libc.abilist: Likewise.
> * sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise.
> * sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise.
> * sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise.
> * sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise.
> * sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise.
> * sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise.
> * sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise.
> * sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist: Likewise.
> * sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise.
> * sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise.
> * sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise.
> * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist:
> Likewise.
> * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist:
> Likewise.
> * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist: Likewise.
> * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist: Likewise.
> * sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise.
> * sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise.
> * sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise.
> * sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise.
> * sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise.
> * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist: Likewise.
> * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist: Likewise.
> * sysdeps/unix/sysv/linux/tilepro/libc.abilist: Likewise.
> * sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise.
> * sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise.
Ping
next prev parent reply other threads:[~2017-04-28 8:57 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-10 15:01 [PATCH] " Dennis Wölfing
2017-04-10 15:18 ` Zack Weinberg
2017-04-10 18:27 ` Dennis Wölfing
2017-04-16 13:19 ` Dennis Wölfing
2017-04-16 13:38 ` Florian Weimer
2017-04-10 16:03 ` Andreas Schwab
2017-04-11 7:55 ` Florian Weimer
2017-04-12 15:24 ` Dennis Wölfing
2017-04-12 16:35 ` Florian Weimer
2017-04-17 14:02 ` [PATCH v2] " Dennis Wölfing
2017-04-17 14:32 ` Florian Weimer
2017-04-17 14:34 ` Paul Eggert
2017-04-17 14:40 ` Dennis Wölfing
2017-04-17 14:44 ` Florian Weimer
2017-04-18 12:34 ` Carlos O'Donell
2017-04-18 14:29 ` Dennis Wölfing
2017-04-18 15:50 ` Carlos O'Donell
2017-04-18 15:57 ` Dennis Wölfing
2017-04-19 15:16 ` Joseph Myers
2017-04-19 15:02 ` Joseph Myers
2017-04-21 12:16 ` [PATCH v3] " Dennis Wölfing
2017-04-28 8:57 ` Dennis Wölfing [this message]
2017-05-08 7:07 ` Dennis Wölfing
2017-05-08 7:34 ` Florian Weimer
2017-05-10 13:03 ` [PATCH v4] " Dennis Wölfing
2017-05-10 21:29 ` DJ Delorie
2017-05-11 17:00 ` Dennis Wölfing
2017-05-11 17:28 ` DJ Delorie
2017-05-11 18:36 ` Dennis Wölfing
2017-05-11 18:41 ` DJ Delorie
2017-05-15 12:22 ` [PATCH v5] " Dennis Wölfing
2017-05-22 14:16 ` Dennis Wölfing
2017-05-22 18:24 ` DJ Delorie
2017-05-22 18:51 ` Zack Weinberg
2017-05-22 20:25 ` [PATCH v6] " Dennis Wölfing
2017-05-29 12:29 ` Dennis Wölfing
2017-05-30 16:02 ` DJ Delorie
2017-05-30 16:17 ` Zack Weinberg
2017-05-30 20:02 ` Dennis Wölfing
2017-05-30 20:35 ` Adhemerval Zanella
2017-05-30 20:38 ` Dennis Wölfing
2017-05-30 20:40 ` Adhemerval Zanella
2017-05-30 20:50 ` [PATCH v7] " Dennis Wölfing
2017-05-30 22:06 ` Adhemerval Zanella
2017-05-30 15:17 ` [PATCH v6] " Adhemerval Zanella
2017-05-30 20:02 ` Dennis Wölfing
2017-05-30 20:16 ` Florian Weimer
2017-05-30 20:27 ` Adhemerval Zanella
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b19175ac-f141-e0e5-49e8-96da56bfb719@gmx.de \
--to=denniswoelfing@gmx.de \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).