Opened 11 years ago

#125 new defect

QIO cannot deal with unlimited line lengths (useful for overchan)

Reported by: Julien ÉLIE Owned by: eagle
Priority: low Milestone:
Component: lib Version:
Severity: minor Keywords:
Cc: wkronert@…

Description

Russ Allbery wrote in an inn-workers posting:

The Second issue I suspect might be a problem with the overview and I might have to rebuild the overview database. Occasionally, I get a notice in the errlog:
Jan 7 21:09:25 gondor overchan[12472]: input line too long, skipping

overchan uses QIO, which means that it can't handle lines longer than 8192 bytes (or st_blksize, but that only applies to reading files from disk). Extremely long References headers can cause the overview information for a single article to be longer than that, as can adding a lot of additional headers to overview. It's a bug in overchan or in QIO.

The problem from the QIO perspective is that you don't want to allow unlimited line lengths since you can then just run yourself out of memory if you're trying to read some mangled file (and QIO is used all over INN). overchan should probably just handle arbitrary input lines.

I suspect we need to make QIO a bit more sophisticated by adding a
parameter to QIOopen specifying the maximum line length, with 0 meaning unlimited, and then have QIO use buffer_* under the hood instead of rolling its own buffer implementation. Then buffer_read will do useful things for you.

Thankfully, we already have a unit test suite for QIO, so it should be possible to do that sort of refactoring and be relatively confident we didn't break anything.

Change History (0)

Note: See TracTickets for help on using tickets.