nasm/nasmlib
H. Peter Anvin (Intel) 5bb35772b3 BR 3392597: the system malloc() can return NULL
malloc(0) can legitimately return NULL; it does on some systems and
not others. Force the size to 1 byte if the size is 0 coming in,
except for realloc() where this is legitimate and equivalent to
free().

Since this is an abnormal case, and can't even happen with most C
libraries, handle it on the error path, after we already got back a
NULL pointer.

Reported-by: Ozkan Sezer <sezeroz@gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2019-08-16 00:41:29 -07:00
..
alloc.c BR 3392597: the system malloc() can return NULL 2019-08-16 00:41:29 -07:00
alloc.h preproc: fix parsing of single-line macro arguments, cleanups 2019-08-09 02:34:21 -07:00
asprintf.c preproc: fix parsing of single-line macro arguments, cleanups 2019-08-09 02:34:21 -07:00
badenum.c Add generic perfect string hashes, use for directives 2017-04-03 00:27:07 -07:00
bsi.c Move <string.h> inclusion to compiler.h 2018-12-26 06:32:37 -08:00
crc64.c hashtbl: revamp the hash table interface, support binary keys 2018-12-11 13:18:49 -08:00
errfile.c Remove #includes already provided by "compiler.h" 2018-12-27 12:45:44 -08:00
file.c update watcom config file. 2019-08-07 17:53:38 -07:00
file.h file.c: handle long pathnames on Windows 2019-05-15 13:07:21 -07:00
filename.c Eliminate filename length restrictions, remote ofmt->filename() 2017-12-20 13:38:20 -08:00
hashtbl.c Move <string.h> inclusion to compiler.h 2018-12-26 06:32:37 -08:00
ilog2.c ilog2(): inline functions if practical 2017-09-27 13:34:42 -07:00
md5c.c Move <string.h> inclusion to compiler.h 2018-12-26 06:32:37 -08:00
mmap.c nasmlib/file: move memory-mapping functions out of file.c 2017-02-23 18:39:00 -08:00
nctype.c Restore the ability to have ? in identifiers, except ? itself 2018-12-14 00:57:05 -08:00
path.c path: nasm_catfile -- Fix incorrect return of filename only 2018-10-19 00:55:54 +03:00
perfhash.c Add generic perfect string hashes, use for directives 2017-04-03 00:27:07 -07:00
perfhash.pl perl files: clean up warnings 2019-08-09 13:30:19 -07:00
raa.c preproc: massive cleanup of smacro expansion 2019-04-25 18:00:32 -07:00
rbtree.c
readnum.c Replace nasm_error(ERR_WARNING|...) with nasm_warn() 2019-08-06 19:18:36 -07:00
realpath.c Remove #includes already provided by "compiler.h" 2018-12-27 12:45:44 -08:00
saa.c SAA: allow seeking beyond the end of the array 2019-02-25 21:02:18 -08:00
string.c ctype: create our own ctype table 2018-11-28 14:55:58 -08:00
strlist.c preproc: fix parsing of single-line macro arguments, cleanups 2019-08-09 02:34:21 -07:00
ver.c nasmlib/ver.[ch]: add "compiler.h" 2018-12-26 06:37:25 -08:00
zerobuf.c