Check lastgc is not NULL before using it, GitHub issue 4935 from Pavel

Lavrukhin.
This commit is contained in:
nicm
2026-03-23 09:05:59 +00:00
parent b88c08f860
commit f7dad4f38f

2
grid.c
View File

@@ -1117,7 +1117,7 @@ grid_string_cells(struct grid *gd, u_int px, u_int py, u_int nx,
if (gc.flags & GRID_FLAG_PADDING)
continue;
if (flags & GRID_STRING_WITH_SEQUENCES) {
if (lastgc != NULL && (flags & GRID_STRING_WITH_SEQUENCES)) {
grid_string_cells_code(*lastgc, &gc, code, sizeof code,
flags, s, &has_link);
codelen = strlen(code);