view modules/xalloc-oversized @ 38240:f9dafd51172a

xalloc-oversized: check for PTRDIFF_MAX too This avoids undefined behavior when subtracting pointers to objects containing more than PTRDIFF_MAX bytes. * lib/xalloc-oversized.h (__xalloc_oversized, xalloc_oversized): Also return 1 if the result would exceed PTRDIFF_MAX> * modules/xalloc-oversized (Depends-on): Add stdint.
author Paul Eggert <eggert@cs.ucla.edu>
date Wed, 14 Dec 2016 17:09:04 -0800
parents c2ba20dc11b1
children
line wrap: on
line source

Description:
Check for memory allocation overflow.  Also see xalloc.

Files:
lib/xalloc-oversized.h

Depends-on:
stdint

configure.ac:

Makefile.am:

Include:
"xalloc-oversized.h"

License:
LGPLv2+

Maintainer:
all