aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc_aux.h
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-04-23 21:06:41 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-04-23 21:06:41 +0000
commitc4641c1dc73700968ee90de85e04b2f32fbadc8a (patch)
tree22eb558acb2454bff882d8b4571d21d8c6fd8e54 /mandoc_aux.h
parent2255a3e49af03406199043bf555c96acf31eb877 (diff)
downloadmandoc-c4641c1dc73700968ee90de85e04b2f32fbadc8a.tar.gz
mandoc-c4641c1dc73700968ee90de85e04b2f32fbadc8a.tar.zst
mandoc-c4641c1dc73700968ee90de85e04b2f32fbadc8a.zip
Audit malloc(3)/calloc(3)/realloc(3) usage.
* Change eight reallocs to reallocarray to be safe from overflows. * Change one malloc to reallocarray to be safe from overflows. * Change one calloc to reallocarray, no zeroing needed. * Change the order of arguments of three callocs (aesthetical).
Diffstat (limited to 'mandoc_aux.h')
-rw-r--r--mandoc_aux.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/mandoc_aux.h b/mandoc_aux.h
index 7cdbde2e..04f4baff 100644
--- a/mandoc_aux.h
+++ b/mandoc_aux.h
@@ -1,4 +1,4 @@
-/* $Id: mandoc_aux.h,v 1.1 2014/03/23 11:59:17 schwarze Exp $ */
+/* $Id: mandoc_aux.h,v 1.2 2014/04/23 21:06:41 schwarze Exp $ */
/*
* Copyright (c) 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -24,6 +24,7 @@ int mandoc_asprintf(char **, const char *, ...);
void *mandoc_calloc(size_t, size_t);
void *mandoc_malloc(size_t);
void *mandoc_realloc(void *, size_t);
+void *mandoc_reallocarray(void *, size_t, size_t);
char *mandoc_strdup(const char *);
char *mandoc_strndup(const char *, size_t);