Use xrealloc(NULL, n, m) instead of xmalloc(n * m) to get overflow

check.
This commit is contained in:
nicm
2014-10-08 17:14:04 +00:00
parent 6610e89689
commit 77efcf8bdd
2 changed files with 3 additions and 2 deletions

View File

@ -279,7 +279,7 @@ paste_make_sample(struct paste_buffer *pb, int utf8flag)
len = pb->size;
if (len > width)
len = width;
buf = xmalloc(len * 4 + 4);
buf = xrealloc(NULL, len, 4 + 4);
if (utf8flag)
used = utf8_strvis(buf, pb->data, len, flags);