]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Fix crash in f-typeprint.c
authorTom Tromey <tom@tromey.com>
Sat, 13 Sep 2025 19:44:10 +0000 (13:44 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 23 Sep 2025 18:21:38 +0000 (12:21 -0600)
commit18400a9cdf6b3d84996a99697a97774f268576c2
tree6f8b13cd2f0d1ef2283c0affdb2b66c40c6516be
parent8bd08ee92c4a7bf2ad9e29c4da32a276ef2257fc
Fix crash in f-typeprint.c

I noticed a crash in f-typeprint.c that was hidden by an xfail:

XFAIL: gdb.fortran/vla-array.exp: print variable length string array type (GDB internal error) (PRMS gcc/101826)

I think this was introduced by commit 6594ca4a ("do not handle a NULL
linebuffer in pager_file::puts") but not detected due to the xfail.

It seems bad for an xfail to cover up a crash but I haven't
investigated that.

Meanwhile, this patch fixes the crash by checking for a NULL pointer
when calling gdb_puts.

Approved-by: Kevin Buettner <kevinb@redhat.com>
gdb/f-typeprint.c