The switch to fgets() from the GNU-libc dependent getline() means that a fixed-size buffer is currently being used to read query lines from the query file, which will overflow if the input line is longer than this.
This should not happen for well-formed data, but still needs rectification.