Package: foremost
Version: 1.5.7-5
Severity: important

When forging a config file with 100 big (1024-bytes) patterns, I get the
message "ERROR: In line 2 of the configuration file."

That:
* does not tell what the problem is
* is suspect because there is no reason why line 1 would have worked and
  not line 2, they have the same structure.  Nevertheless a 1-line config
  file does not report the error.
* does not give a clue about whether line 3 and later are even looked at

Furthermore, the config-parsing code issuing this message is quite strangely
formulated.


What happens is that read buffer is sized by MAX_STRING_LENGTH, which is defined
to be 1024, but the code does not check that it indeed got a line, and strtok
(which sucks) will happily corrupt memory after the buffer.  Which luckily I
didn't have the time to suffer from, but well...

Furthermore, this MAX_STRING_LENGTH is at the
same time the max length for a line, and the max length for suffix, header,
and footer.  A bit of nonsense, I would say.

Reply via email to