Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755167AbZKQSzg (ORCPT ); Tue, 17 Nov 2009 13:55:36 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751986AbZKQSzf (ORCPT ); Tue, 17 Nov 2009 13:55:35 -0500 Received: from metis.ext.pengutronix.de ([92.198.50.35]:49317 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751902AbZKQSzf (ORCPT ); Tue, 17 Nov 2009 13:55:35 -0500 Date: Tue, 17 Nov 2009 19:55:39 +0100 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, Michael Buesch , Peter Zijlstra , Andrew Morton Subject: Re: [PATCH] strcmp: fix overflow error Message-ID: <20091117185539.GA23385@pengutronix.de> References: <1258476700-21323-1-git-send-email-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-SA-Exim-Connect-IP: 2001:6f8:1178:2:215:17ff:fe12:23b0 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1033 Lines: 29 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 (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/