use of uninitialised value in input_file_open
authorAlan Modra <amodra@gmail.com>
Thu, 16 Jun 2022 06:50:05 +0000 (16:20 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 16 Jun 2022 06:57:35 +0000 (16:27 +0930)
commit633de7089179f455d94d0fef54c68c298f545242
tree0804e9222307e0b60df9e8ac202f9aa7bbe7eecc
parent370426d0da768345fb53683c803d6d5a20558065
use of uninitialised value in input_file_open

Triggered by a file containing just "#N" or "#A".  fgets when hitting
EOF before reading anything returns NULL and does not write to buf.
strchr (buf, '\n') then is reading from uninitialised memory.

* input-file.c (input_file_open): Don't assume buf contains
zero string terminator when fgets returns NULL.
gas/input-file.c