diff options
| author | Po Lu | 2023-05-18 09:04:57 +0800 |
|---|---|---|
| committer | Po Lu | 2023-05-18 09:04:57 +0800 |
| commit | 074c0268fd32d6527e124cff386bb6b15cf90017 (patch) | |
| tree | 62111c3c70d46a738f15514e988a707409ca45f4 /src/coding.c | |
| parent | db48eff8cf4a88393c0209f663ca194ee37fa747 (diff) | |
| parent | 5ef169ed701fa4f850fdca5563cdd468207d5d4f (diff) | |
| download | emacs-074c0268fd32d6527e124cff386bb6b15cf90017.tar.gz emacs-074c0268fd32d6527e124cff386bb6b15cf90017.zip | |
Merge remote-tracking branch 'origin/master' into feature/android
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 fbf10188819..96c3827c326 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)) |