mirror of
https://github.com/bellard/quickjs.git
synced 2026-05-27 19:09:36 +00:00
memcpy() (currently) has undefined behavior if a pointer is NULL with zero size (#500)
This commit is contained in:
parent
b1b4733bd9
commit
1f50b39e99
@ -1189,7 +1189,8 @@ int unicode_normalize(uint32_t **pdst, const uint32_t *src, int src_len,
|
||||
goto not_latin1;
|
||||
}
|
||||
buf = (int *)dbuf->buf;
|
||||
memcpy(buf, src, src_len * sizeof(int));
|
||||
if (src_len != 0)
|
||||
memcpy(buf, src, src_len * sizeof(int));
|
||||
*pdst = (uint32_t *)buf;
|
||||
return src_len;
|
||||
not_latin1: ;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user