diff options
| author | Vibhav Pant | 2023-06-06 19:30:27 +0530 |
|---|---|---|
| committer | Vibhav Pant | 2023-06-06 19:30:27 +0530 |
| commit | 49ffcbf86a32a8a217538d4df3736fe069ccf35d (patch) | |
| tree | a5f16157cc20fb19a844473a6fbd2b434f4c8260 /src/coding.c | |
| parent | af569fa3d90a717983b743eb97adbf869c6d1736 (diff) | |
| parent | 7ca1d782f5910d0c3978c6798a45c6854ec668c7 (diff) | |
| download | emacs-49ffcbf86a32a8a217538d4df3736fe069ccf35d.tar.gz emacs-49ffcbf86a32a8a217538d4df3736fe069ccf35d.zip | |
Merge branch 'master' into scratch/comp-static-data
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/coding.c b/src/coding.c index a2e0d7040f8..f014749c4ea 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -989,7 +989,7 @@ static void | |||
| 989 | coding_alloc_by_realloc (struct coding_system *coding, ptrdiff_t bytes) | 989 | coding_alloc_by_realloc (struct coding_system *coding, ptrdiff_t bytes) |
| 990 | { | 990 | { |
| 991 | ptrdiff_t newbytes; | 991 | ptrdiff_t newbytes; |
| 992 | if (INT_ADD_WRAPV (coding->dst_bytes, bytes, &newbytes) | 992 | if (ckd_add (&newbytes, coding->dst_bytes, bytes) |
| 993 | || SIZE_MAX < newbytes) | 993 | || SIZE_MAX < newbytes) |
| 994 | string_overflow (); | 994 | string_overflow (); |
| 995 | coding->destination = xrealloc (coding->destination, newbytes); | 995 | coding->destination = xrealloc (coding->destination, newbytes); |
| @@ -7059,9 +7059,8 @@ produce_chars (struct coding_system *coding, Lisp_Object translation_table, | |||
| 7059 | { | 7059 | { |
| 7060 | eassert (growable_destination (coding)); | 7060 | eassert (growable_destination (coding)); |
| 7061 | ptrdiff_t dst_size; | 7061 | ptrdiff_t dst_size; |
| 7062 | if (INT_MULTIPLY_WRAPV (to_nchars, MAX_MULTIBYTE_LENGTH, | 7062 | if (ckd_mul (&dst_size, to_nchars, MAX_MULTIBYTE_LENGTH) |
| 7063 | &dst_size) | 7063 | || ckd_add (&dst_size, dst_size, buf_end - buf)) |
| 7064 | || INT_ADD_WRAPV (buf_end - buf, dst_size, &dst_size)) | ||
| 7065 | memory_full (SIZE_MAX); | 7064 | memory_full (SIZE_MAX); |
| 7066 | dst = alloc_destination (coding, dst_size, dst); | 7065 | dst = alloc_destination (coding, dst_size, dst); |
| 7067 | if (EQ (coding->src_object, coding->dst_object)) | 7066 | if (EQ (coding->src_object, coding->dst_object)) |