[coreboot] [PATCH] v3: Improve printk reliability

Peter Stuge peter at stuge.se
Thu Mar 19 14:35:11 CET 2009


Mathias Krause wrote:
> > +			for (i = 0; i < len; ++i)
> > +				if (!isprint(*s[i]))
> > +					s = "<GARBAGE>";
> 
> No offense,

None taken. We very much appreciate your contribution!


> but isn't there a break missing in the loop when we assign s to be
> "<GARBAGE>"?

Yes. Good find. Thank you for spotting it!


> Otherwise we may access invalid data if len is greater than
> strlen("<GARBAGE>") because we have changed the base we're looking
> at.

Yup. r1159


//Peter




More information about the coreboot mailing list