diff options
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/etags.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c index 174c33a7a5f..eee2c596262 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c | |||
| @@ -124,6 +124,7 @@ University of California, as described above. */ | |||
| 124 | #include <binary-io.h> | 124 | #include <binary-io.h> |
| 125 | #include <intprops.h> | 125 | #include <intprops.h> |
| 126 | #include <unlocked-io.h> | 126 | #include <unlocked-io.h> |
| 127 | #include <verify.h> | ||
| 127 | #include <c-ctype.h> | 128 | #include <c-ctype.h> |
| 128 | #include <c-strcase.h> | 129 | #include <c-strcase.h> |
| 129 | 130 | ||
| @@ -7310,6 +7311,8 @@ static void * | |||
| 7310 | xnmalloc (ptrdiff_t nitems, ptrdiff_t item_size) | 7311 | xnmalloc (ptrdiff_t nitems, ptrdiff_t item_size) |
| 7311 | { | 7312 | { |
| 7312 | ptrdiff_t nbytes; | 7313 | ptrdiff_t nbytes; |
| 7314 | assume (0 <= nitems); | ||
| 7315 | assume (0 < item_size); | ||
| 7313 | if (INT_MULTIPLY_WRAPV (nitems, item_size, &nbytes)) | 7316 | if (INT_MULTIPLY_WRAPV (nitems, item_size, &nbytes)) |
| 7314 | memory_full (); | 7317 | memory_full (); |
| 7315 | return xmalloc (nbytes); | 7318 | return xmalloc (nbytes); |
| @@ -7319,6 +7322,8 @@ static void * | |||
| 7319 | xnrealloc (void *pa, ptrdiff_t nitems, ptrdiff_t item_size) | 7322 | xnrealloc (void *pa, ptrdiff_t nitems, ptrdiff_t item_size) |
| 7320 | { | 7323 | { |
| 7321 | ptrdiff_t nbytes; | 7324 | ptrdiff_t nbytes; |
| 7325 | assume (0 <= nitems); | ||
| 7326 | assume (0 < item_size); | ||
| 7322 | if (INT_MULTIPLY_WRAPV (nitems, item_size, &nbytes) || SIZE_MAX < nbytes) | 7327 | if (INT_MULTIPLY_WRAPV (nitems, item_size, &nbytes) || SIZE_MAX < nbytes) |
| 7323 | memory_full (); | 7328 | memory_full (); |
| 7324 | void *result = realloc (pa, nbytes); | 7329 | void *result = realloc (pa, nbytes); |