commit | 633de7089179f455d94d0fef54c68c298f545242 | [log] [tgz] |
---|---|---|
author | Alan Modra <amodra@gmail.com> | Thu Jun 16 16:20:05 2022 +0930 |
committer | Alan Modra <amodra@gmail.com> | Thu Jun 16 16:27:35 2022 +0930 |
tree | 0804e9222307e0b60df9e8ac202f9aa7bbe7eecc | |
parent | 370426d0da768345fb53683c803d6d5a20558065 [diff] |
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.