Messages in this thread | | | Date | Tue, 17 Nov 2009 19:55:39 +0100 | From | Uwe Kleine-König <> | Subject | Re: [PATCH] strcmp: fix overflow error |
| |
Hello Linus,
On Tue, Nov 17, 2009 at 09:41:58AM -0800, Linus Torvalds wrote: > On Tue, 17 Nov 2009, Uwe Kleine-König wrote: > > > > strcmp("\x01", "\xef") returns 18 but it should return something < 0. > > The reason is that the variable holding the result of the subtraction is > > too small and overflows. > > No. The reason is that whoever wrote that function is a moron and doesn't > know the standard. And your fix is not correct _either_ OK, right.
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
(BTW, this was already broken in 2.4.0, so I was unable to find out who is the moron :-)
Best regards Uwe
-- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ | -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |