Do not crash on a zero size character.

pull/3012/head
nicm 2021-12-20 09:02:12 +00:00
parent c6149adf55
commit e4856de8bf
1 changed files with 5 additions and 0 deletions

View File

@ -3148,6 +3148,11 @@ window_copy_cellstring(const struct grid_line *gl, u_int px, size_t *size,
}
utf8_to_data(gl->extddata[gce->offset].data, &ud);
if (ud.size == 0) {
*size = 0;
*allocated = 0;
return (NULL);
}
*size = ud.size;
*allocated = 1;