mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-20 12:40:56 -08:00
(decode_coding_emacs_mule): Handle insufficent source correctly.
This commit is contained in:
parent
4f918f606b
commit
6eced09c3d
2 changed files with 24 additions and 2 deletions
21
src/coding.c
21
src/coding.c
|
|
@ -1024,9 +1024,26 @@ decode_coding_emacs_mule (coding, source, destination, src_bytes, dst_bytes)
|
|||
}
|
||||
else
|
||||
{
|
||||
bytes = CHAR_STRING (*src, tmp);
|
||||
p = tmp;
|
||||
int i, c;
|
||||
|
||||
bytes = BYTES_BY_CHAR_HEAD (*src);
|
||||
src++;
|
||||
for (i = 1; i < bytes; i++)
|
||||
{
|
||||
ONE_MORE_BYTE (c);
|
||||
if (CHAR_HEAD_P (c))
|
||||
break;
|
||||
}
|
||||
if (i < bytes)
|
||||
{
|
||||
bytes = CHAR_STRING (*src_base, tmp);
|
||||
p = tmp;
|
||||
src = src_base + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
p = src_base;
|
||||
}
|
||||
}
|
||||
if (dst + bytes >= (dst_bytes ? dst_end : src))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue