diff options
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/etags.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c index 2c6b4e7a630..147ecbd7c1b 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c | |||
| @@ -109,6 +109,7 @@ University of California, as described above. */ | |||
| 109 | #include <limits.h> | 109 | #include <limits.h> |
| 110 | #include <unistd.h> | 110 | #include <unistd.h> |
| 111 | #include <stdarg.h> | 111 | #include <stdarg.h> |
| 112 | #include <stdckdint.h> | ||
| 112 | #include <stdlib.h> | 113 | #include <stdlib.h> |
| 113 | #include <string.h> | 114 | #include <string.h> |
| 114 | #include <sysstdio.h> | 115 | #include <sysstdio.h> |
| @@ -8038,7 +8039,7 @@ xnmalloc (ptrdiff_t nitems, ptrdiff_t item_size) | |||
| 8038 | ptrdiff_t nbytes; | 8039 | ptrdiff_t nbytes; |
| 8039 | assume (0 <= nitems); | 8040 | assume (0 <= nitems); |
| 8040 | assume (0 < item_size); | 8041 | assume (0 < item_size); |
| 8041 | if (INT_MULTIPLY_WRAPV (nitems, item_size, &nbytes)) | 8042 | if (ckd_mul (&nbytes, nitems, item_size)) |
| 8042 | memory_full (); | 8043 | memory_full (); |
| 8043 | return xmalloc (nbytes); | 8044 | return xmalloc (nbytes); |
| 8044 | } | 8045 | } |
| @@ -8049,7 +8050,7 @@ xnrealloc (void *pa, ptrdiff_t nitems, ptrdiff_t item_size) | |||
| 8049 | ptrdiff_t nbytes; | 8050 | ptrdiff_t nbytes; |
| 8050 | assume (0 <= nitems); | 8051 | assume (0 <= nitems); |
| 8051 | assume (0 < item_size); | 8052 | assume (0 < item_size); |
| 8052 | if (INT_MULTIPLY_WRAPV (nitems, item_size, &nbytes) || SIZE_MAX < nbytes) | 8053 | if (ckd_mul (&nbytes, nitems, item_size) || SIZE_MAX < nbytes) |
| 8053 | memory_full (); | 8054 | memory_full (); |
| 8054 | void *result = realloc (pa, nbytes); | 8055 | void *result = realloc (pa, nbytes); |
| 8055 | if (!result) | 8056 | if (!result) |