[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#504721: Possible reason for serial console misdetection

Frans Pop <elendil@planet.nl> writes:

> On Wednesday 03 December 2008, Ferenc Wagner wrote:
>> Don't you risk overflowing the buffer by not using a union of the two
>> structs?  Or are both guarranteed to never grow above 256 bytes?
> The original code looks to have included a "paranoia" field in struct u of 
> 3 times the size of serial_struct, probably for that reason.
> I'd think using 512 or even 1024 as buffer size may indeed be safer.

But why magic constants?  Why not a simple union of the two structs?
The original "paranoia" isn't any better in this respect.  Or do we
try to avoid the need to recompile if the struct is later extended?
That sounds silly...  Maybe I'll learn something now.

Reply to: